diff --git a/src/main/cogs/booru.py b/src/main/cogs/booru.py index d2394fb..3bbb532 100644 --- a/src/main/cogs/booru.py +++ b/src/main/cogs/booru.py @@ -437,8 +437,7 @@ class MsG: raise exc.GoTo elif reaction.emoji == '➡' and reaction.message.content == paginator.content and (user is ctx.author or user.id == u.config['owner_id']): raise exc.Right - else: - return False + return False def on_message(msg): with suppress(ValueError): @@ -611,8 +610,7 @@ class MsG: raise exc.GoTo elif reaction.emoji == '➡' and reaction.message.content == paginator.content and (user is ctx.author or user.id == u.config['owner_id']): raise exc.Right - else: - return False + return False def on_message(msg): with suppress(ValueError): diff --git a/src/main/cogs/owner.py b/src/main/cogs/owner.py index a23bdac..934514f 100644 --- a/src/main/cogs/owner.py +++ b/src/main/cogs/owner.py @@ -59,17 +59,20 @@ class Bot: async def invite(self, ctx): await ctx.send('🔗 https://discordapp.com/oauth2/authorize?&client_id={}&scope=bot&permissions={}'.format(u.config['client_id'], u.config['permissions']), delete_after=10) - @commands.command(aliases=['presence', 'game'], hidden=True) + @commands.command(name=',status', aliases=[',presence', ',game'], hidden=True) @commands.is_owner() @checks.del_ctx() - async def status(self, ctx, game): - try: - if game is not None: - await self.bot.change_presence(game=d.Game(name=game)) - else: - raise exc.NotFound - except exc.NotFound: - await ctx.send('❌ **No game given.**', delete_after=10) + async def status(self, ctx, *, game=None): + if game is not None: + await self.bot.change_presence(game=d.Game(name=game)) + u.config['playing'] = game + u.dump(u.config, 'config.json', json=True) + else: + await self.bot.change_presence(game=None) + u.config['playing'] = 'None' + u.dump(u.config, 'config.json', json=True) + + await ctx.message.add_reaction('✅') class Tools: diff --git a/src/main/run.py b/src/main/run.py index fdb15e9..eff7bba 100644 --- a/src/main/run.py +++ b/src/main/run.py @@ -34,6 +34,11 @@ async def on_ready(): # bot.loop.create_task(u.clear(booru.temp_urls, 30*60)) + if u.config['playing'] is not 'None': + await bot.change_presence(game=d.Game(name=u.config['playing'])) + else: + await bot.change_presence(game=None) + if isinstance(bot.get_channel(u.config['startup_channel']), d.TextChannel): await bot.get_channel(u.config['startup_channel']).send('**Started** ☀️ .') print('\n\\ \\ \\ \\ \\ \\ \\ \\ \\\nC O N N E C T E D : {}\n/ / / / / / / / /\n'.format(bot.user.name))