mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 03:40:11 +01:00
style: new code layout
This commit is contained in:
35
cogs/owner/shutdown.py
Normal file
35
cogs/owner/shutdown.py
Normal file
@@ -0,0 +1,35 @@
|
||||
"""
|
||||
Copyright © Krypton 2019-Present - https://github.com/kkrypt0nn (https://krypton.ninja)
|
||||
Description:
|
||||
🐍 A simple template to start to code your own and personalized Discord bot in Python
|
||||
|
||||
Version: 6.4.0
|
||||
"""
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ext.commands import Context
|
||||
|
||||
|
||||
class Shutdown(commands.Cog, name="shutdown"):
|
||||
def __init__(self, bot) -> None:
|
||||
self.bot = bot
|
||||
|
||||
@commands.hybrid_command(
|
||||
name="shutdown",
|
||||
description="Make the bot shutdown.",
|
||||
)
|
||||
@commands.is_owner()
|
||||
async def shutdown(self, context: Context) -> None:
|
||||
"""
|
||||
Shuts down the bot.
|
||||
|
||||
:param context: The hybrid command context.
|
||||
"""
|
||||
embed = discord.Embed(description="Shutting down. Bye! :wave:", color=0xBEBEFE)
|
||||
await context.send(embed=embed)
|
||||
await self.bot.close()
|
||||
|
||||
|
||||
async def setup(bot) -> None:
|
||||
await bot.add_cog(Shutdown(bot))
|
||||
Reference in New Issue
Block a user