mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 11:40:12 +01:00
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:
@@ -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'")
|
||||
|
||||
Reference in New Issue
Block a user