ignore case of keywords
This commit is contained in:
parent
72853709ee
commit
6e93a63c40
|
|
@ -22,6 +22,7 @@ python_requires = >=3.8
|
|||
install_requires =
|
||||
click
|
||||
deltachat
|
||||
requests
|
||||
|
||||
[options.packages.find]
|
||||
where = src
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import requests
|
||||
import deltachat
|
||||
|
||||
|
||||
|
|
@ -59,7 +60,7 @@ def rm_keyword(msg: deltachat.Message):
|
|||
def check_and_forward(msg: deltachat.Message, admin_chat: deltachat.Chat):
|
||||
"""Check a message for keywords, and forward it to the admin chat if one matches."""
|
||||
for word in list_keywords(msg.account):
|
||||
if word in msg.text:
|
||||
if word.lower() in msg.text.lower():
|
||||
admin_chat.send_msg(msg)
|
||||
print(f"Forwarding message because of '{word}': {msg.text}")
|
||||
break
|
||||
|
|
|
|||
Loading…
Reference in a new issue