aboutsummaryrefslogtreecommitdiff
path: root/bot.py
diff options
context:
space:
mode:
authorAnInternetTroll <lucafulger@gmail.com>2020-06-05 17:47:19 +0000
committerAnInternetTroll <lucafulger@gmail.com>2020-06-05 17:47:19 +0000
commitbfa568af62117bc7b55f13926d4c2802081002a6 (patch)
treef5a7cd98732b459bb74f65ac24fb031a2f12d308 /bot.py
parent6580e4104f003bd6f22a0e833677c43ce8d942a0 (diff)
downloadsteve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.tar
steve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.tar.gz
steve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.tar.bz2
steve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.tar.lz
steve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.tar.xz
steve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.tar.zst
steve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.zip
Added blacklist
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):