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



# TODO: Sort out admin commands, mod commands, the settings before ever pushing this to general use. It needs to be a mod only thing. # 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(): class CustomCommands():
def __init__(self, Bot): def __init__(self, Bot):
self.bot = Bot self.bot = Bot
self.servers = self.con.servers self.servers = self.con.servers


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

Loading…
Cancel
Save