From c4c672d90132f65f250a4e69bf27168ac40e4fbf Mon Sep 17 00:00:00 2001 From: Myned Date: Fri, 1 Dec 2017 19:27:42 -0500 Subject: [PATCH 1/2] Tweaked presence command and added ability to opt out with empty string --- src/main/cogs/owner.py | 2 +- src/main/run.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/cogs/owner.py b/src/main/cogs/owner.py index 2b21810..fd0b560 100644 --- a/src/main/cogs/owner.py +++ b/src/main/cogs/owner.py @@ -79,7 +79,7 @@ class Bot: await ctx.send(f'**Game changed to** `{game}`') else: await self.bot.change_presence(game=None) - u.config['playing'] = 'None' + u.config['playing'] = '' u.dump(u.config, 'config.json', json=True) await ctx.send('**Game changed to** ` `') diff --git a/src/main/run.py b/src/main/run.py index a34d7de..094cb71 100644 --- a/src/main/run.py +++ b/src/main/run.py @@ -77,10 +77,8 @@ async def on_ready(): # bot.loop.create_task(u.clear(booru.temp_urls, 30*60)) - if u.config['playing'] is not 'None': + if u.config['playing'] is not '': await bot.change_presence(game=d.Game(name=u.config['playing'])) - else: - await bot.change_presence(game=None) print('\n> > > > > > > > >\nC O N N E C T E D : {}\n> > > > > > > > >\n'.format(bot.user.name)) await bot.get_channel(u.config['info_channel']).send('**Started** \N{BLACK SUN WITH RAYS} .') From b348814fe02210c91f760b55fdf729f05d260925 Mon Sep 17 00:00:00 2001 From: Myned Date: Fri, 1 Dec 2017 19:28:13 -0500 Subject: [PATCH 2/2] Changed string boolean to boolean --- src/main/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/utils/utils.py b/src/main/utils/utils.py index 4a08229..57fca4e 100644 --- a/src/main/utils/utils.py +++ b/src/main/utils/utils.py @@ -30,7 +30,7 @@ try: except FileNotFoundError: with open('config.json', 'w') as outfile: jsn.dump({'client_id': 0, 'info_channel': 0, 'owner_id': 0, 'permissions': 126016, - 'playing': 'a game', 'prefix': [',', 'm,'], 'selfbot': 'False', 'token': 'str'}, outfile, indent=4, sort_keys=True) + 'playing': 'a game', 'prefix': [',', 'm,'], 'selfbot': False, 'token': 'str'}, outfile, indent=4, sort_keys=True) raise FileNotFoundError( 'FILE NOT FOUND : config.json created with abstract values. Restart run.py with correct values')