Create tasks.py

This commit is contained in:
Corban-Lee Jones 2023-12-17 00:49:12 +00:00
parent 7ddfe09e4d
commit 994b940e0f

35
src/extensions/tasks.py Normal file
View File

@ -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")