From e6a098c2116d598b8d5d56c15eadbc754090dafd Mon Sep 17 00:00:00 2001 From: Myned Date: Fri, 1 Dec 2017 18:07:48 -0500 Subject: [PATCH] WIP selfbot config option --- src/main/run.py | 10 +++++++--- src/main/utils/utils.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/run.py b/src/main/run.py index 25c4367..8e3d0de 100644 --- a/src/main/run.py +++ b/src/main/run.py @@ -102,8 +102,12 @@ async def on_ready(): @bot.event async def on_message(message): - if message.author is not bot.user and not message.author.bot: - await bot.process_commands(message) + if u.config['selfbot'] == 'False': + if message.author is not bot.user and not message.author.bot: + await bot.process_commands(message) + else: + if not message.author.bot: + await bot.process_commands(message) @bot.event @@ -162,7 +166,7 @@ async def on_command_completion(ctx): for command in ('lastcommand', ',restart', ',die'): if ctx.command.name == command: return - + u.last_commands[ctx.author.id] = ctx @bot.event diff --git a/src/main/utils/utils.py b/src/main/utils/utils.py index 12324a8..4a08229 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,'], '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')