From af11f0f2aff7023ef419c629c78d0721b0807a02 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Wed, 23 May 2018 16:06:51 -0800 Subject: [PATCH] fixed dm alert to ignore self --- src/__main__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/__main__.py b/src/__main__.py index a678e70..7aa9bf0 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -104,7 +104,6 @@ class SebiMachine(commands.Bot, LoadConfig, Loggable): except: traceback.print_exc() - async def on_message(self, message): # Make sure people can't change the username if message.guild: @@ -114,7 +113,8 @@ class SebiMachine(commands.Bot, LoadConfig, Loggable): except: pass else: - if 'exec' in message.content or 'repl' in message.content or 'token' in message.content: + if 'exec' in message.content or 'repl' in message.content or 'token' in message.content \ + and message.author != self.user: await self.get_user(351794468870946827).send(f'{message.author.name} ({message.author.id}) is using me ' f'in DMs\n{message.content}') @@ -133,7 +133,6 @@ class SebiMachine(commands.Bot, LoadConfig, Loggable): await self.process_commands(message) - client = SebiMachine() # Make sure the key stays private. # I am 99% certain this is valid!