fixed blocklist & tested it
parent
e75f0996e6
commit
209ff7c92d
7
user.py
7
user.py
|
@ -7,6 +7,7 @@ from pylibscrypt import scrypt_mcf, scrypt_mcf_check
|
||||||
from os import urandom
|
from os import urandom
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class User(object):
|
class User(object):
|
||||||
def __init__(self, uid):
|
def __init__(self, uid):
|
||||||
|
@ -95,11 +96,11 @@ schlitz
|
||||||
db.execute("SELECT words FROM badwords WHERE user_id=?;",
|
db.execute("SELECT words FROM badwords WHERE user_id=?;",
|
||||||
(self.uid, ))
|
(self.uid, ))
|
||||||
badwords = db.cur.fetchone()
|
badwords = db.cur.fetchone()
|
||||||
for word in report.text.lower().splitlines():
|
for word in report.text.lower().split():
|
||||||
if word in badwords:
|
if word in badwords[0].splitlines():
|
||||||
logger.error("Word " + word + " triggered the spam filter on message: " + report.text)
|
logger.error("Word " + word + " triggered the spam filter on message: " + report.text)
|
||||||
return False
|
return False
|
||||||
for word in report.text.lower().splitlines():
|
for word in report.text.lower().split():
|
||||||
if word in default_badwords.splitlines():
|
if word in default_badwords.splitlines():
|
||||||
logger.error("Word " + word + " triggered the spam filter on message: " + report.text)
|
logger.error("Word " + word + " triggered the spam filter on message: " + report.text)
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue