feat(mcquote): new command :)

Introduces a new /mcquote command that generates a custom Minecraft achievement quote image using skinmc.net. Updates README and media cog to register and document the new command.
This commit is contained in:
neoarz
2025-10-04 12:29:01 -04:00
parent 804eaa39a6
commit 592d697140
3 changed files with 157 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ from discord.ext import commands
from discord.ext.commands import Context
from .download import download_command
from .mcquote import mcquote_command
def _require_group_prefix(context: Context) -> bool:
@@ -28,7 +29,7 @@ class Media(commands.GroupCog, name="media"):
color=0x7289DA
)
embed.set_author(name="Media", icon_url="https://yes.nighty.works/raw/y5SEZ9.webp")
embed.add_field(name="Available", value="download", inline=False)
embed.add_field(name="Available", value="download, mcquote", inline=False)
await context.send(embed=embed)
async def _invoke_hybrid(self, context: Context, name: str):
@@ -42,6 +43,10 @@ class Media(commands.GroupCog, name="media"):
async def media_group_download(self, context: Context, *, url: str):
await self._invoke_hybrid(context, "download", url=url)
@media_group.command(name="mcquote")
async def media_group_mcquote(self, context: Context, *, text: str):
await self._invoke_hybrid(context, "mcquote", text=text)
@commands.check(_require_group_prefix)
@commands.hybrid_command(
name="download",
@@ -50,8 +55,17 @@ class Media(commands.GroupCog, name="media"):
async def download(self, context, *, url: str):
return await download_command()(self, context, url=url)
@commands.check(_require_group_prefix)
@commands.hybrid_command(
name="mcquote",
description="Generate a custom Minecraft quote image.",
)
async def mcquote(self, context, *, text: str):
return await mcquote_command()(self, context, text=text)
async def setup(bot) -> None:
cog = Media(bot)
await bot.add_cog(cog)
bot.logger.info("Loaded extension 'media.download'")
bot.logger.info("Loaded extension 'media.mcquote'")