Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cogs/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,9 @@ async def on_ready(self) -> None:
await self.bot.close()

logger.info("Ready! Logged in as %s", self.bot.user)

try:
log_channel: discord.TextChannel = await self.bot.fetch_log_channel()
await log_channel.send("TeX-Bot is now running!")
except ValueError:
logger.debug("Unable to send startup message to log channel!")
7 changes: 7 additions & 0 deletions utils/tex_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ def __init__(self, *args: object, **options: object) -> None:

@override
async def close(self) -> NoReturn: # type: ignore[misc]

try:
log_channel: discord.TextChannel = await self.fetch_log_channel()
await log_channel.send("TeX-Bot is shutting down...")
except ValueError:
logger.debug("Unable to send shutdown message to log channel!")

await super().close()

logger.info("TeX-Bot manually terminated.")
Expand Down