Skip to content

Commit

Permalink
fix: remove config
Browse files Browse the repository at this point in the history
  • Loading branch information
howardt12345 committed Jan 15, 2025
1 parent ee1d05e commit 4f86420
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os

import discord
from discord import app_commands

# from discord.ext import commands
from dotenv import load_dotenv
Expand Down Expand Up @@ -37,7 +36,6 @@

from mentioned import mention_responses

from modules.supabase import supabaseClient
from modules import config
import bot
import sys
Expand Down Expand Up @@ -154,18 +152,15 @@ async def on_message(message: discord.Message):

@self.client.event
async def on_guild_join(guild: discord.Guild):
supabaseClient.table("server_config").insert(
{
"guild_id": str(guild.id),
"server_name": guild.name,
}
).execute()
config.create_new_config(guild.id, guild.name, IS_PROD)
await self.tree.sync(guild=guild)

@self.client.event
async def on_guild_remove(guild: discord.Guild):
print(f"Guild {guild.name} removed")
self.guilds.remove(discord.Object(id=guild.id))
del self.client.guilds_dict[guild.id]
config.remove_config(guild.id, IS_PROD)

def run(self):
self.client.run(TOKEN)
Expand Down

0 comments on commit 4f86420

Please sign in to comment.