aboutsummaryrefslogtreecommitdiff
path: root/bot.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--[-rwxr-xr-x]bot.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/bot.py b/bot.py
index 62645f3..2721110 100755..100644
--- a/bot.py
+++ b/bot.py
@@ -49,21 +49,31 @@ class BedrockBot(commands.Bot):
game = discord.Game("Mining away")
await self.change_presence(activity=game)
+ with open('blacklist.json', 'r') as f:
+ try:
+ self.blacklist = json.load(f)
+ except json.decoder.JSONDecodeError:
+ self.blacklist = []
+
self.logger.warning(f'Online: {self.user} (ID: {self.user.id})')
async def on_message(self, message):
if message.author.bot:
return
+ if message.author.id in self.blacklist:
+ return
await self.process_commands(message)
try:
command = message.content.split()[0]
except IndexError:
pass
-
- if command in self.custom_commands:
- await message.channel.send(self.custom_commands[command])
+ try:
+ if command in self.custom_commands:
+ await message.channel.send(self.custom_commands[command])
+ return
+ except:
return
def run(self):