diff --git a/cogs/startup.py b/cogs/startup.py index 0e179caac..06c30dee6 100644 --- a/cogs/startup.py +++ b/cogs/startup.py @@ -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!") diff --git a/utils/tex_bot.py b/utils/tex_bot.py index 1b1902d84..9baf9de8f 100644 --- a/utils/tex_bot.py +++ b/utils/tex_bot.py @@ -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.")