ignore case of keywords

This commit is contained in:
missytake 2025-08-30 00:08:41 +02:00
parent 72853709ee
commit 6e93a63c40
Signed by: missytake
GPG key ID: 04CC6658320518DF
2 changed files with 3 additions and 1 deletions

View file

@ -22,6 +22,7 @@ python_requires = >=3.8
install_requires =
click
deltachat
requests
[options.packages.find]
where = src

View file

@ -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