mirror of
https://github.com/tgbot-collection/YYeTsBot.git
synced 2025-11-25 11:29:38 +08:00
add whitelist
This commit is contained in:
@@ -51,6 +51,9 @@ def send_mail(to: str, subject: str, body: str):
|
|||||||
def check_spam(ip, ua, author, content) -> int:
|
def check_spam(ip, ua, author, content) -> int:
|
||||||
# 0 means okay
|
# 0 means okay
|
||||||
token = os.getenv("askismet")
|
token = os.getenv("askismet")
|
||||||
|
whitelist: "list" = os.getenv("whitelist", "").split(",")
|
||||||
|
if author in whitelist:
|
||||||
|
return 0
|
||||||
if token:
|
if token:
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(Exception):
|
||||||
akismet = Akismet(token, blog="https://yyets.dmesg.app/")
|
akismet = Akismet(token, blog="https://yyets.dmesg.app/")
|
||||||
|
|||||||
Reference in New Issue
Block a user