From 994b940e0fc00393952a16f1a19f3938a7fc9113 Mon Sep 17 00:00:00 2001 From: corbz Date: Sun, 17 Dec 2023 00:49:12 +0000 Subject: [PATCH] Create tasks.py --- src/extensions/tasks.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/extensions/tasks.py 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")