From 7c2cedef62362c77f3a438a00173f18ef9a894ca Mon Sep 17 00:00:00 2001 From: Uwe Pfeifer Date: Fri, 11 Nov 2022 21:45:54 +0100 Subject: [PATCH] Adding administration.py. First push. --- ext/administration.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ext/administration.py diff --git a/ext/administration.py b/ext/administration.py new file mode 100644 index 0000000..be03eea --- /dev/null +++ b/ext/administration.py @@ -0,0 +1,22 @@ +# administration.py by freaky (freaky@freakyonline.de) +# --- +# +# This extension is for administrating the bot. + +import discord +from discord import app_commands +from discord.ext import commands + +class AdminExt(commands.GroupCog, name="admin"): + def __init__(self, bot: commands.Bot) -> None: + self.bot = bot + super().__init__() # this is now required in this context. + + @app_commands.command(name="stop") + async def admin_stop(self, interaction: discord.Interaction) -> None: + """ /admin stop """ + await interaction.response.send_message("The bot will now shutdown. Good bye! :)", ephemeral=True) + + +async def setup(bot: commands.Bot) -> None: + await bot.add_cog(AdminExt(bot)) \ No newline at end of file