This commit is contained in:
Nikolaj
2024-10-30 15:31:46 +01:00
parent e955ef4e28
commit 2f4e606fbf
9 changed files with 1032 additions and 3 deletions

View File

@ -3,21 +3,32 @@ from gwendolyn.utils import PARAMS as params
class MiscExtension(Extension):
"""Contains the miscellaneous commands."""
@slash_command(**params["misc"]["gen_name"])
async def gen_name(self, ctx: SlashContext):
await self.bot.other.generate_name(ctx)
@slash_command(**params["misc"]["hello"])
async def hello(self, ctx: SlashContext):
"""Greet the bot."""
await self.other.hello_func(ctx)
await self.bot.other.hello_func(ctx)
@slash_command(**params["misc"]["help"])
async def help(self, ctx: SlashContext, command=""):
"""Get help for commands."""
await self.bot.other.help_func(ctx, command)
@slash_command(**params["misc"]["ping"])
async def ping(self, ctx: SlashContext):
"""Send the bot's latency."""
await ctx.send(f"Pong!\nLatency is {round(self.bot.latency * 1000)}ms")
latency = self.bot.latency
if latency > 100:
await ctx.send("Cannot measure latency :(")
else:
await ctx.send(f"Pong!\nLatency is {round(self.bot.latency * 1000)}ms")
@slash_command(**params["misc"]["roll"])
async def roll(self, ctx: SlashContext, dice: str = "1d20"):
await self.bot.other.roll_dice(ctx, dice)
@slash_command(**params["misc"]["thank"])
async def thank(self, ctx: SlashContext):