From f4f1472e34a6e38616663330273fc9f764e934f5 Mon Sep 17 00:00:00 2001 From: Abigail Gold Date: Fri, 4 Oct 2019 13:46:40 -0400 Subject: [PATCH] add restart command --- cogs/infocog.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cogs/infocog.py b/cogs/infocog.py index 2d895a4..b285202 100644 --- a/cogs/infocog.py +++ b/cogs/infocog.py @@ -21,6 +21,18 @@ class InfoCog(commands.Cog): embed = embed.add_field(name="License", value=self.gs.info.license) await ctx.send(embed=embed) + @commands.command(name="restart") + async def _restart_bot(self, ctx): + """Restarts the bot.""" + if ctx.author.id in self.gs.opt.owners_uids: + await ctx.message.add_reaction("✅") + await self.bot.logout() + else: + try: + await ctx.message.add_reaction("❌") + except: + return + def setup(bot): bot.add_cog(InfoCog(bot))