Move the cogs into a subdir

This commit is contained in:
Marc Di Luzio 2024-08-13 22:42:52 +01:00
parent 93337ebde9
commit d3cdec3965
6 changed files with 4 additions and 4 deletions

32
py/cogs/owner_cog.py Normal file
View file

@ -0,0 +1,32 @@
"""
Owner bot cog
"""
import logging
from discord.ext import commands
logger = logging.getLogger("owner")
logger.setLevel(logging.INFO)
class OwnerCog(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command()
@commands.dm_only()
@commands.is_owner()
async def sync(self, ctx: commands.Context):
"""Handle sync command"""
msg = await ctx.reply(content="Syncing commands...", ephemeral=True)
synced = await self.bot.tree.sync()
logger.info("Synced %s command(s)", len(synced))
await msg.edit(content="Done!")
@commands.command()
@commands.dm_only()
@commands.is_owner()
async def close(self, ctx: commands.Context):
"""Handle restart command"""
await ctx.reply("Closing bot...", ephemeral=True)
logger.info("Closing down the bot")
await self.bot.close()