Skip to content

Commit

Permalink
add shutdown message
Browse files Browse the repository at this point in the history
  • Loading branch information
probablyjassin committed Dec 1, 2024
1 parent 6fe6f8c commit 563d5a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from discord.ext import commands

from logger import setup_logger
from config import DISCORD_TOKEN
from config import DISCORD_TOKEN, LOG_CHANNEL_ID
from models.CustomMogiContext import MogiApplicationContext

logger = setup_logger(__name__)
Expand All @@ -26,6 +26,8 @@ async def get_application_context(self, interaction, cls=MogiApplicationContext)
return await super().get_application_context(interaction, cls=cls)

async def close(self):
if channel := self.get_channel(LOG_CHANNEL_ID):
await channel.send("🔄 Bot is shutting down...")
for name, cog in self.cogs.items():
cog._eject(self)
print(f"Ejected {name}")
Expand Down

0 comments on commit 563d5a3

Please sign in to comment.