소스 검색

fixed bug where cc's would ignore blacklist

tags/v1.3.0
roxie 6 년 전
부모
커밋
0bb4f7f5f6
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. +10
    -0
      cogs/customcommands.py

+ 10
- 0
cogs/customcommands.py 파일 보기

@@ -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…
취소
저장