From 6ad1e296f17720c69bd130cbca11728256215756 Mon Sep 17 00:00:00 2001 From: neoarz Date: Mon, 29 Sep 2025 21:17:04 -0400 Subject: [PATCH] feat(dontasktoask): new command --- README.md | 2 +- cogs/help.py | 4 +++- cogs/miscellaneous/__init__.py | 16 +++++++++++++++- cogs/miscellaneous/dontasktoask.py | 26 ++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 cogs/miscellaneous/dontasktoask.py diff --git a/README.md b/README.md index 0baaf46..ccfe3b8 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ | moderation | `kick`, `ban`, `nick`, `purge`, `hackban`, `warnings`, `archive` | | sidestore | `sidestore`, `refresh`, `code`, `crash`, `pairing`, `server`, `half`, `sparse`, `afc`, `udid` | | idevice | `idevice`, `noapps`, `errorcode`, `developermode`, `mountddi` | -| miscellaneous | `keanu`, `labubu`, `piracy`, `tryitandsee`, `rickroll` | +| miscellaneous | `keanu`, `labubu`, `piracy`, `tryitandsee`, `rickroll`, `dontasktoask` | | utilities | `translate` | ## Download diff --git a/cogs/help.py b/cogs/help.py index 6f68742..132edcc 100644 --- a/cogs/help.py +++ b/cogs/help.py @@ -40,9 +40,11 @@ class Help(commands.Cog, name="help"): "general": "general", "fun": "fun", "idevice": "idevice", + "misc": "miscellaneous", "miscellaneous": "miscellaneous", "moderation": "moderation", "sidestore": "sidestore", + "utils": "utilities", "utilities": "utilities", "sync": "owner", @@ -180,4 +182,4 @@ class Help(commands.Cog, name="help"): async def setup(bot) -> None: - await bot.add_cog(Help(bot)) \ No newline at end of file + await bot.add_cog(Help(bot)) diff --git a/cogs/miscellaneous/__init__.py b/cogs/miscellaneous/__init__.py index 1314059..2467edb 100644 --- a/cogs/miscellaneous/__init__.py +++ b/cogs/miscellaneous/__init__.py @@ -2,6 +2,7 @@ import discord from discord.ext import commands from discord.ext.commands import Context +from .dontasktoask import dontasktoask_command from .rickroll import rr_command from .labubu import labubu_command from .tryitandsee import tryitandsee_command @@ -21,7 +22,7 @@ class Miscellaneous(commands.GroupCog, name="misc"): 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) + embed.add_field(name="Available", value="dontasktoask, rr, labubu, tryitandsee, piracy, keanu", inline=False) await context.send(embed=embed) async def _invoke_hybrid(self, context: Context, name: str): @@ -41,6 +42,10 @@ class Miscellaneous(commands.GroupCog, name="misc"): content = context.message.content.strip().lower() return content.startswith(f"{prefix}{group} ") + @miscellaneous_group.command(name="dontasktoask") + async def miscellaneous_group_dontasktoask(self, context: Context): + await self._invoke_hybrid(context, "dontasktoask") + @miscellaneous_group.command(name="rr") async def miscellaneous_group_rr(self, context: Context): await self._invoke_hybrid(context, "rr") @@ -61,6 +66,14 @@ class Miscellaneous(commands.GroupCog, name="misc"): async def miscellaneous_group_keanu(self, context: Context): await self._invoke_hybrid(context, "keanu") + @commands.check(_require_group_prefix) + @commands.hybrid_command( + name="dontasktoask", + description="Shows the 'Don't Ask to Ask' image." + ) + async def dontasktoask(self, context): + return await dontasktoask_command()(self, context) + @commands.check(_require_group_prefix) @commands.hybrid_command( name="rr", @@ -105,6 +118,7 @@ async def setup(bot) -> None: cog = Miscellaneous(bot) await bot.add_cog(cog) + bot.logger.info("Loaded extension 'miscellaneous.dontasktoask'") bot.logger.info("Loaded extension 'miscellaneous.rr'") bot.logger.info("Loaded extension 'miscellaneous.labubu'") bot.logger.info("Loaded extension 'miscellaneous.tryitandsee'") diff --git a/cogs/miscellaneous/dontasktoask.py b/cogs/miscellaneous/dontasktoask.py new file mode 100644 index 0000000..d05589e --- /dev/null +++ b/cogs/miscellaneous/dontasktoask.py @@ -0,0 +1,26 @@ +import discord +from discord.ext import commands +from discord.ext.commands import Context + +def dontasktoask_command(): + @commands.hybrid_command( + name="dontasktoask", + description="Shows the 'Don't Ask to Ask' image." + ) + async def dontasktoask(self, context): + embed = discord.Embed( + color=0x7289DA + ) + embed.set_author(name="Don't Ask to Ask", icon_url="https://yes.nighty.works/raw/YxMC0r.png") + embed.set_image(url="https://yes.nighty.works/raw/KecbCr.jpg") + + if getattr(context, "interaction", None): + inter = context.interaction + if not inter.response.is_done(): + await inter.response.send_message(embed=embed, ephemeral=False) + else: + await inter.followup.send(embed=embed, ephemeral=True) + else: + await context.send(embed=embed) + + return dontasktoask