Browse Source

fixed bug where cc's would ignore blacklist

tags/v1.3.0
roxie 6 years ago
parent
commit
0bb4f7f5f6
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      cogs/customcommands.py

+ 10
- 0
cogs/customcommands.py View File

@@ -6,6 +6,14 @@ import load_config

# TODO: Sort out admin commands, mod commands, the settings before ever pushing this to general use. It needs to be a mod only thing.

def blacklisted(user):
with open("config/blacklist.txt", "r") as fp:
for line in fp.readlines():
if user.id+"\n" == line:
return True
return False


class CustomCommands():
def __init__(self, Bot):
self.bot = Bot
@@ -13,6 +21,8 @@ class CustomCommands():
self.servers = self.con.servers

async def on_message(self, message):
if blacklisted(message.author):
return
msg = message.content.lower()
channel = message.channel
server = message.server.id

Loading…
Cancel
Save