Adding administration.py. First push.
This commit is contained in:
parent
a8f870d4a0
commit
7c2cedef62
1 changed files with 22 additions and 0 deletions
22
ext/administration.py
Normal file
22
ext/administration.py
Normal file
|
@ -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))
|
Loading…
Add table
Reference in a new issue