Skip to content

Commit

Permalink
filters are now case insensitive and closes UsergeTeam#170
Browse files Browse the repository at this point in the history
  • Loading branch information
rking32 committed Nov 5, 2020
1 parent ed4a585 commit 1616462
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions userge/plugins/utils/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,12 @@ async def chat_filter(message: Message) -> None:
if getattr(message, media_type, None):
reply = True
elif message.text:
input_text = message.text.strip()
if (input_text == name
or input_text.startswith(f"{name} ")
or input_text.endswith(f" {name}")
or f" {name} " in input_text):
l_name = name.lower()
input_text = message.text.strip().lower()
if (input_text == l_name
or input_text.startswith(f"{l_name} ")
or input_text.endswith(f" {l_name}")
or f" {l_name} " in input_text):
reply = True
if reply:
await CHANNEL.forward_stored(client=message.client,
Expand Down

0 comments on commit 1616462

Please sign in to comment.