mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 03:40:11 +01:00
feat(silly): new commad & botinfo now does discord-py version
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
| Command group | Subcommands |
|
| Command group | Subcommands |
|
||||||
| ------------ | --- |
|
| ------------ | --- |
|
||||||
@@ -30,7 +30,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`, `docs` `sigma`, `duck` |
|
| miscellaneous | `keanu`, `labubu`, `piracy`, `tryitandsee`, `rickroll`, `dontasktoask`, `support`, `depart`, `docs` `sigma`, `duck`, `silly` |
|
||||||
| utilities | `translate`, `codepreview`, `dictionary` |
|
| utilities | `translate`, `codepreview`, `dictionary` |
|
||||||
| media | `download`, `mcquote`, `img2gif`, `tweety`, `tts` |
|
| media | `download`, `mcquote`, `img2gif`, `tweety`, `tts` |
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ class BotInfo(commands.Cog, name="botinfo"):
|
|||||||
"**New to Syntrel?** Run `/help` to get started and explore all available commands!\n\n"
|
"**New to Syntrel?** Run `/help` to get started and explore all available commands!\n\n"
|
||||||
f"**Owner:** [neoarz](https://discordapp.com/users/1015372540937502851)\n"
|
f"**Owner:** [neoarz](https://discordapp.com/users/1015372540937502851)\n"
|
||||||
f"**Python Version:** {platform.python_version()}\n"
|
f"**Python Version:** {platform.python_version()}\n"
|
||||||
|
f"**Discord.py Version:** {discord.__version__}\n"
|
||||||
f"**Prefix:** / (Slash Commands) or {self.bot.bot_prefix} for normal commands"
|
f"**Prefix:** / (Slash Commands) or {self.bot.bot_prefix} for normal commands"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -132,6 +133,7 @@ class BotInfo(commands.Cog, name="botinfo"):
|
|||||||
"**New to Syntrel?** Run `/help` to get started and explore all available commands!\n\n"
|
"**New to Syntrel?** Run `/help` to get started and explore all available commands!\n\n"
|
||||||
f"**Owner:** [neoarz](https://discordapp.com/users/1015372540937502851)\n"
|
f"**Owner:** [neoarz](https://discordapp.com/users/1015372540937502851)\n"
|
||||||
f"**Python Version:** {platform.python_version()}\n"
|
f"**Python Version:** {platform.python_version()}\n"
|
||||||
|
f"**Discord.py Version:** {discord.__version__}\n"
|
||||||
f"**Prefix:** / (Slash Commands) or {self.bot.bot_prefix} for normal commands"
|
f"**Prefix:** / (Slash Commands) or {self.bot.bot_prefix} for normal commands"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ from .keanu import keanu_command
|
|||||||
from .support import support_command
|
from .support import support_command
|
||||||
from .docs import docs_command
|
from .docs import docs_command
|
||||||
from .sigma import sigma_command
|
from .sigma import sigma_command
|
||||||
|
from .silly import silly_command
|
||||||
|
|
||||||
|
|
||||||
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
|
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
|
||||||
@@ -31,7 +32,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, duck, tryitandsee, piracy, keanu, support, docs", inline=False)
|
embed.add_field(name="Available", value="dontasktoask, rr, depart, labubu, duck, tryitandsee, piracy, keanu, support, docs, sigma, silly", 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):
|
||||||
@@ -95,6 +96,10 @@ class Miscellaneous(commands.GroupCog, name="misc"):
|
|||||||
async def miscellaneous_group_sigma(self, context: Context):
|
async def miscellaneous_group_sigma(self, context: Context):
|
||||||
await self._invoke_hybrid(context, "sigma")
|
await self._invoke_hybrid(context, "sigma")
|
||||||
|
|
||||||
|
@miscellaneous_group.command(name="silly")
|
||||||
|
async def miscellaneous_group_silly(self, context: Context, message_type: str = "regular"):
|
||||||
|
await self._invoke_hybrid(context, "silly", message_type=message_type)
|
||||||
|
|
||||||
@commands.check(_require_group_prefix)
|
@commands.check(_require_group_prefix)
|
||||||
@commands.hybrid_command(
|
@commands.hybrid_command(
|
||||||
name="dontasktoask",
|
name="dontasktoask",
|
||||||
@@ -183,6 +188,21 @@ class Miscellaneous(commands.GroupCog, name="misc"):
|
|||||||
async def sigma(self, context):
|
async def sigma(self, context):
|
||||||
return await sigma_command()(self, context)
|
return await sigma_command()(self, context)
|
||||||
|
|
||||||
|
@commands.check(_require_group_prefix)
|
||||||
|
@commands.hybrid_command(
|
||||||
|
name="silly",
|
||||||
|
description="Sends a silly message :3"
|
||||||
|
)
|
||||||
|
@app_commands.describe(
|
||||||
|
message_type="Type of message to send (regular or animated)"
|
||||||
|
)
|
||||||
|
@app_commands.choices(message_type=[
|
||||||
|
app_commands.Choice(name="Regular", value="regular"),
|
||||||
|
app_commands.Choice(name="Animated", value="animated")
|
||||||
|
])
|
||||||
|
async def silly(self, context, message_type: str = "regular"):
|
||||||
|
return await silly_command()(self, context, message_type=message_type)
|
||||||
|
|
||||||
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)
|
||||||
@@ -198,3 +218,4 @@ async def setup(bot) -> None:
|
|||||||
bot.logger.info("Loaded extension 'miscellaneous.support'")
|
bot.logger.info("Loaded extension 'miscellaneous.support'")
|
||||||
bot.logger.info("Loaded extension 'miscellaneous.docs'")
|
bot.logger.info("Loaded extension 'miscellaneous.docs'")
|
||||||
bot.logger.info("Loaded extension 'miscellaneous.sigma'")
|
bot.logger.info("Loaded extension 'miscellaneous.sigma'")
|
||||||
|
bot.logger.info("Loaded extension 'miscellaneous.silly'")
|
||||||
|
|||||||
32
cogs/miscellaneous/silly.py
Normal file
32
cogs/miscellaneous/silly.py
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import discord
|
||||||
|
from discord.ext import commands
|
||||||
|
from discord.ext.commands import Context
|
||||||
|
|
||||||
|
|
||||||
|
def silly_command():
|
||||||
|
@commands.hybrid_command(
|
||||||
|
name="silly",
|
||||||
|
description="Sends a silly message :3",
|
||||||
|
)
|
||||||
|
async def silly(self, context, message_type: str = "regular"):
|
||||||
|
if message_type == "animated":
|
||||||
|
message = "https://yes.nighty.works/raw/LX4nqt.gif"
|
||||||
|
else:
|
||||||
|
message = ":3"
|
||||||
|
|
||||||
|
interaction = getattr(context, "interaction", None)
|
||||||
|
if interaction is not None:
|
||||||
|
await interaction.response.defer(ephemeral=True)
|
||||||
|
await context.channel.send(message)
|
||||||
|
try:
|
||||||
|
await interaction.delete_original_response()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
await context.message.delete()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
await context.channel.send(message)
|
||||||
|
|
||||||
|
return silly
|
||||||
Reference in New Issue
Block a user