diff --git a/src/extensions/tasks.py b/src/extensions/tasks.py new file mode 100644 index 0000000..9c3207b --- /dev/null +++ b/src/extensions/tasks.py @@ -0,0 +1,35 @@ +""" +Extension for the `TaskCog`. +Loading this file via `commands.Bot.load_extension` will add `TaskCog` to the bot. +""" + +import logging + +from discord.ext import commands + +log = logging.getLogger(__name__) + + +class TaskCog(commands.Cog): + """ + Command cog. + """ + + def __init__(self, bot): + super().__init__() + self.bot = bot + + @commands.Cog.listener() + async def on_ready(self): + log.info(f"{self.__class__.__name__} cog is ready") + + +async def setup(bot): + """ + Setup function for this extension. + Adds `TaskCog` to the bot. + """ + + cog = TaskCog(bot) + await bot.add_cog(cog) + log.info(f"Added {cog.__class__.__name__} cog")