✨
This commit is contained in:
@ -1,9 +1,41 @@
|
||||
from interactions import Extension, slash_command, SlashContext
|
||||
from interactions import Extension, slash_command, SlashContext, Status
|
||||
from gwendolyn.utils import PARAMS as params
|
||||
|
||||
class MiscExtension(Extension):
|
||||
"""Contains the miscellaneous commands."""
|
||||
|
||||
@slash_command()
|
||||
@slash_command(**params["misc"]["hello"])
|
||||
async def hello(self, ctx: SlashContext):
|
||||
"""Greet the bot."""
|
||||
await ctx.send(f"Hello, I'm {self.bot.user.mention}!")
|
||||
await self.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")
|
||||
|
||||
@slash_command(**params["misc"]["thank"])
|
||||
async def thank(self, ctx: SlashContext):
|
||||
"""Thank the bot."""
|
||||
await ctx.send("You're welcome :blush:")
|
||||
|
||||
@slash_command(**params["misc"]["stop"])
|
||||
async def stop(self, ctx: SlashContext):
|
||||
if f"{ctx.author.id}" in self.bot.admins:
|
||||
await ctx.send("Goodnight...")
|
||||
|
||||
await self.bot.change_presence(status=Status.INVISIBLE)
|
||||
|
||||
# self.bot.database_funcs.wipe_games()
|
||||
|
||||
self.bot.log("Logging out", level=25)
|
||||
await self.bot.stop()
|
||||
else:
|
||||
log_message = f"{ctx.author.display_name} tried to stop me!"
|
||||
self.bot.log(log_message, str(ctx.channel_id))
|
||||
await ctx.send(f"I don't think I will, {ctx.author.display_name}")
|
||||
|
Reference in New Issue
Block a user