fix bug checking url entities in message
This commit is contained in:
+3
-1
@@ -19,6 +19,7 @@ app = Flask(__name__)
|
|||||||
|
|
||||||
print(">>> LutzBot is running! <<<")
|
print(">>> LutzBot is running! <<<")
|
||||||
|
|
||||||
|
|
||||||
zen_rows = ['Beautiful is better than ugly.', 'Explicit is better than implicit.', 'Simple is better than complex.',
|
zen_rows = ['Beautiful is better than ugly.', 'Explicit is better than implicit.', 'Simple is better than complex.',
|
||||||
'Complex is better than complicated.', 'Flat is better than nested.', 'Sparse is better than dense.',
|
'Complex is better than complicated.', 'Flat is better than nested.', 'Sparse is better than dense.',
|
||||||
'Readability counts.',
|
'Readability counts.',
|
||||||
@@ -63,8 +64,9 @@ def check_delete_list(type_message: types.Message) -> bool:
|
|||||||
for phrase in unwanted_phrases:
|
for phrase in unwanted_phrases:
|
||||||
if phrase in type_message.text.casefold():
|
if phrase in type_message.text.casefold():
|
||||||
return True
|
return True
|
||||||
|
if type_message.entities:
|
||||||
for entity in type_message.entities:
|
for entity in type_message.entities:
|
||||||
if phrase in entity.url:
|
if entity.url and phrase in entity.url:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user