feat(docs): new command :)

This commit is contained in:
neoarz
2025-10-08 15:29:01 -04:00
parent 087b8095e2
commit 94a0e89dc3
3 changed files with 45 additions and 2 deletions

View File

@@ -27,7 +27,7 @@
| sidestore | `help`, `refresh`, `code`, `crash`, `pairing`, `server`, `half`, `sparse`, `afc`, `udid` | | sidestore | `help`, `refresh`, `code`, `crash`, `pairing`, `server`, `half`, `sparse`, `afc`, `udid` |
| idevice | `help`, `noapps`, `errorcode`, `developermode`, `mountddi` | | idevice | `help`, `noapps`, `errorcode`, `developermode`, `mountddi` |
| melonx | `help`, `transfer`, `mods`, `gamecrash`, `requirements`, `error`, `26` | | melonx | `help`, `transfer`, `mods`, `gamecrash`, `requirements`, `error`, `26` |
| miscellaneous | `keanu`, `labubu`, `piracy`, `tryitandsee`, `rickroll`, `dontasktoask`, `support`, `depart`| | miscellaneous | `keanu`, `labubu`, `piracy`, `tryitandsee`, `rickroll`, `dontasktoask`, `support`, `depart`, `docs`|
| utilities | `translate`, `codepreview`, `dictionary` | | utilities | `translate`, `codepreview`, `dictionary` |
| media | `download`, `mcquote`, `img2gif`, `tweety` | | media | `download`, `mcquote`, `img2gif`, `tweety` |

View File

@@ -10,6 +10,7 @@ from .tryitandsee import tryitandsee_command
from .piracy import piracy_command from .piracy import piracy_command
from .keanu import keanu_command from .keanu import keanu_command
from .support import support_command from .support import support_command
from .docs import docs_command
class Miscellaneous(commands.GroupCog, name="misc"): class Miscellaneous(commands.GroupCog, name="misc"):
def __init__(self, bot) -> None: def __init__(self, bot) -> None:
@@ -24,7 +25,7 @@ class Miscellaneous(commands.GroupCog, name="misc"):
color=0x7289DA color=0x7289DA
) )
embed.set_author(name="Miscellaneous", icon_url="https://yes.nighty.works/raw/YxMC0r.png") embed.set_author(name="Miscellaneous", icon_url="https://yes.nighty.works/raw/YxMC0r.png")
embed.add_field(name="Available", value="dontasktoask, rr, depart, labubu, tryitandsee, piracy, keanu, support", inline=False) embed.add_field(name="Available", value="dontasktoask, rr, depart, labubu, tryitandsee, piracy, keanu, support, docs", inline=False)
await context.send(embed=embed) await context.send(embed=embed)
async def _invoke_hybrid(self, context: Context, name: str): async def _invoke_hybrid(self, context: Context, name: str):
@@ -76,6 +77,10 @@ class Miscellaneous(commands.GroupCog, name="misc"):
async def miscellaneous_group_support(self, context: Context): async def miscellaneous_group_support(self, context: Context):
await self._invoke_hybrid(context, "support") await self._invoke_hybrid(context, "support")
@miscellaneous_group.command(name="docs")
async def miscellaneous_group_docs(self, context: Context):
await self._invoke_hybrid(context, "docs")
@commands.check(_require_group_prefix) @commands.check(_require_group_prefix)
@commands.hybrid_command( @commands.hybrid_command(
name="dontasktoask", name="dontasktoask",
@@ -140,6 +145,14 @@ class Miscellaneous(commands.GroupCog, name="misc"):
async def support(self, context): async def support(self, context):
return await support_command()(self, context) return await support_command()(self, context)
@commands.check(_require_group_prefix)
@commands.hybrid_command(
name="docs",
description="Shows the docs image."
)
async def docs(self, context):
return await docs_command()(self, context)
async def setup(bot) -> None: async def setup(bot) -> None:
cog = Miscellaneous(bot) cog = Miscellaneous(bot)
await bot.add_cog(cog) await bot.add_cog(cog)
@@ -152,3 +165,4 @@ async def setup(bot) -> None:
bot.logger.info("Loaded extension 'miscellaneous.piracy'") bot.logger.info("Loaded extension 'miscellaneous.piracy'")
bot.logger.info("Loaded extension 'miscellaneous.keanu'") bot.logger.info("Loaded extension 'miscellaneous.keanu'")
bot.logger.info("Loaded extension 'miscellaneous.support'") bot.logger.info("Loaded extension 'miscellaneous.support'")
bot.logger.info("Loaded extension 'miscellaneous.docs'")

View File

@@ -0,0 +1,29 @@
import discord
from discord.ext import commands
from discord.ext.commands import Context
import aiohttp
import io
def docs_command():
@commands.hybrid_command(
name="docs",
description="Shows the docs image."
)
async def docs(self, context):
url = "https://yes.nighty.works/raw/akdx0q.webp"
async with aiohttp.ClientSession() as session:
async with session.get(url) as resp:
data = await resp.read()
file = discord.File(io.BytesIO(data), filename="docs.webp")
if getattr(context, "interaction", None):
inter = context.interaction
if not inter.response.is_done():
await inter.response.send_message(file=file, ephemeral=False)
else:
await inter.followup.send(file=file, ephemeral=True)
else:
await context.send(file=file)
return docs