diff --git a/Music-bot/cogs/meta.py b/Music-bot/cogs/meta.py index 337b45672650bc2b33a3298f54b146945bd66074..23f555ad2bda7e17e8ce2b7b9791c4644ef007cc 100644 --- a/Music-bot/cogs/meta.py +++ b/Music-bot/cogs/meta.py @@ -1,5 +1,6 @@ import discord import datetime +import asyncio import os from discord.ext import commands @@ -71,6 +72,19 @@ class Meta: @commands.is_owner() async def _quit(self, ctx): """Quits the bot.""" + channel = ctx.channel + await ctx.send(f'Please confirm the action, the bot will quit entirely.' + f'You need to confirm it by saying just "confirm".') + + def check(m): + return m.content == 'confirm' and m.channel == channel + + try: + msg = await self.bot.wait_for('message', timeout=30.0, check=check) + except asyncio.TimeoutError: + return await ctx.send('You took long. Goodbye.') + + await ctx.send(f'Confirmed, exiting...') await self.bot.logout() @commands.command(name="about")