From dc0142a29e7f0a2aef4a0628ea030492309048ac Mon Sep 17 00:00:00 2001 From: Myned Date: Tue, 19 Feb 2019 23:06:52 -0500 Subject: [PATCH] Remove OS-dependent notifications --- src/cogs/owner.py | 2 -- src/run.py | 3 +-- src/utils/utils.py | 5 ----- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/cogs/owner.py b/src/cogs/owner.py index 578e9d6..8129593 100644 --- a/src/cogs/owner.py +++ b/src/cogs/owner.py @@ -37,7 +37,6 @@ class Bot: # for task in loop: # task.cancel() print('\n< < < < < < < < < < < <\nD I S C O N N E C T E D\n< < < < < < < < < < < <\n') - # u.notify('D I S C O N N E C T E D') await self.bot.logout() @cmds.command(name=',restart', aliases=[',res', ',r'], hidden=True) @@ -47,7 +46,6 @@ class Bot: print('\n^ ^ ^ ^ ^ ^ ^ ^ ^ ^\nR E S T A R T I N G\n^ ^ ^ ^ ^ ^ ^ ^ ^ ^\n') await self.bot.get_channel(u.config['info_channel']).send('**Restarting** \N{SLEEPING SYMBOL} . . .') - # u.notify('R E S T A R T I N G') chantype = 'guild' if isinstance(ctx.channel, d.TextChannel) else 'private' u.temp['startup'] = (chantype, ctx.channel.id if chantype == 'guild' else ctx.author.id, ctx.message.id) diff --git a/src/run.py b/src/run.py index 2d1c7c7..7d79677 100644 --- a/src/run.py +++ b/src/run.py @@ -156,7 +156,7 @@ async def on_error(error, *args, **kwargs): u.temp.clear() u.dump(u.temp, 'temp/temp.pkl') - # u.notify('E R R O R') + await bot.logout() @@ -191,7 +191,6 @@ async def on_command_error(ctx, error): await bot.get_channel(u.config['info_channel']).send('**COMMAND ERROR** \N{WARNING SIGN} `{}` from {} in {}\n```\n{}```'.format(ctx.message.content, ctx.author.name, ctx.channel.mention if isinstance(ctx.channel, d.channel.TextChannel) else 'DMs', error)) await exc.send_error(ctx, error) await u.add_reaction(ctx.message, '\N{WARNING SIGN}') - # u.notify('C O M M A N D E R R O R') # @bot.event # async def on_command(ctx): diff --git a/src/utils/utils.py b/src/utils/utils.py index 04fb8d7..7808eb7 100644 --- a/src/utils/utils.py +++ b/src/utils/utils.py @@ -20,11 +20,6 @@ from misc import exceptions as exc print('\nPID : {}\n'.format(os.getpid())) -# def notify(message): -# subprocess.run(['terminal-notifier', '-message', message, '-title', -# 'Modumind', '-activate', 'com.apple.Terminal', '-appIcon', 'icon.png', '-sound', 'Ping'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - try: with open('config.json') as infile: config = jsn.load(infile)