diff --git a/cogs/miscellaneous/__init__.py b/cogs/miscellaneous/__init__.py index 216489d..8d91534 100644 --- a/cogs/miscellaneous/__init__.py +++ b/cogs/miscellaneous/__init__.py @@ -13,6 +13,44 @@ class Miscellaneous(commands.GroupCog, name="miscellaneous"): self.bot = bot super().__init__() + @commands.group(name="miscellaneous", invoke_without_command=True) + async def miscellaneous_group(self, context: Context): + embed = discord.Embed( + title="Miscellaneous Commands", + description="Use `.miscellaneous ` or `/miscellaneous `.", + color=0x7289DA + ) + embed.set_author(name="Miscellaneous", icon_url="https://yes.nighty.works/raw/YxMC0r.png") + embed.add_field(name="Available", value="rr, labubu, tryitandsee, piracy, keanu", inline=False) + await context.send(embed=embed) + + async def _invoke_hybrid(self, context: Context, name: str): + command = self.bot.get_command(name) + if command is not None: + await context.invoke(command) + else: + await context.send(f"Unknown miscellaneous command: {name}") + + @miscellaneous_group.command(name="rr") + async def miscellaneous_group_rr(self, context: Context): + await self._invoke_hybrid(context, "rr") + + @miscellaneous_group.command(name="labubu") + async def miscellaneous_group_labubu(self, context: Context): + await self._invoke_hybrid(context, "labubu") + + @miscellaneous_group.command(name="tryitandsee") + async def miscellaneous_group_tryitandsee(self, context: Context): + await self._invoke_hybrid(context, "tryitandsee") + + @miscellaneous_group.command(name="piracy") + async def miscellaneous_group_piracy(self, context: Context): + await self._invoke_hybrid(context, "piracy") + + @miscellaneous_group.command(name="keanu") + async def miscellaneous_group_keanu(self, context: Context): + await self._invoke_hybrid(context, "keanu") + @commands.hybrid_command( name="rr", description="Rickroll" diff --git a/cogs/utilities/__init__.py b/cogs/utilities/__init__.py index ec862e4..7b5d12d 100644 --- a/cogs/utilities/__init__.py +++ b/cogs/utilities/__init__.py @@ -9,6 +9,27 @@ class Utilities(commands.GroupCog, name="utilities"): self.bot = bot super().__init__() + @commands.group(name="utilities", invoke_without_command=True) + async def utilities_group(self, context: Context): + embed = discord.Embed( + title="Utilities Commands", + description="Use `.utilities ` or `/utilities `.", + color=0x7289DA + ) + embed.add_field(name="Available", value="translate", inline=False) + await context.send(embed=embed) + + async def _invoke_hybrid(self, context: Context, name: str, **kwargs): + command = self.bot.get_command(name) + if command is not None: + await context.invoke(command, **kwargs) + else: + await context.send(f"Unknown utilities command: {name}") + + @utilities_group.command(name="translate") + async def utilities_group_translate(self, context: Context, text: str = None, to_lang: str = "en", from_lang: str = None): + await self._invoke_hybrid(context, "translate", text=text, to_lang=to_lang, from_lang=from_lang) + @commands.hybrid_command( name="translate", description="Translate text to another language"