Add command to close the bot

This commit is contained in:
Marc Di Luzio 2024-08-10 00:01:43 +01:00
parent ca24cb4b93
commit 1816e38db6

View file

@ -47,6 +47,16 @@ async def sync(ctx: commands.Context):
await msg.edit(content="Done!") await msg.edit(content="Done!")
@bot.command()
@commands.dm_only()
@commands.check(lambda ctx: ctx.message.author.id in config.OWNERS)
async def close(ctx: commands.Context):
"""Handle restart command"""
await ctx.reply("Closing bot...", ephemeral=True)
logger.info("Closing down the bot")
await bot.close()
@bot.tree.command(description="Match up matchees") @bot.tree.command(description="Match up matchees")
@commands.guild_only() @commands.guild_only()
@app_commands.describe(group_min="Minimum matchees per match (defaults to 3)", @app_commands.describe(group_min="Minimum matchees per match (defaults to 3)",