diff --git a/wulkabot/bot.py b/wulkabot/bot.py index f550e53..3cdb8b4 100644 --- a/wulkabot/bot.py +++ b/wulkabot/bot.py @@ -20,6 +20,7 @@ class Wulkabot(commands.Bot): async def setup_hook(self) -> None: self.http_client = aiohttp.ClientSession() await self.load_extensions(cogs) + await self.tree.sync() async def on_connect(self) -> None: print(f"Connected as {self.user}") @@ -42,7 +43,7 @@ class Wulkabot(commands.Bot): return name.rsplit(".", maxsplit=1)[-1] extensions = set() - for package in pkgutil.walk_packages(module.__path__, module.__name__ + "."): + for package in pkgutil.walk_packages(module.__path__, f"{module.__name__}."): if package.ispkg or unqualify(package.name).startswith("_"): continue extensions.add(package.name) diff --git a/wulkabot/cogs/development.py b/wulkabot/cogs/development.py deleted file mode 100644 index d246b7c..0000000 --- a/wulkabot/cogs/development.py +++ /dev/null @@ -1,22 +0,0 @@ -from discord.ext import commands - -from .. import bot - - -class Development(commands.Cog): - def __init__(self, bot: bot.Wulkabot) -> None: - super().__init__() - self.bot = bot - - @commands.command() - @commands.has_role("Maintainer") - async def sync(self, ctx: commands.Context): - """Synchronizuje komendy bota""" - - commands = await self.bot.tree.sync() - commands_str = ", ".join(c.name for c in commands) - await ctx.reply(f"Zsynchronizowano **{len(commands)}** komend\n{commands_str}") - - -async def setup(bot: bot.Wulkabot): - await bot.add_cog(Development(bot))