Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.4.6 #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ License -> https://github.com/TharukRenuja/NSTC-Movie-Finder/blob/main/LICENSE
- [Mahesh](https://github.com/Mahesh0253) for Media Search Bot.
- [TrojanzHex](https://github.com/TroJanzHEX) for Auto Filter Bot.
- [Me](https://github.com/TharukRenuja) for Nothing🤣.
- [EvaMaria](https://github.com/EvaMaria) for EvaMaria Bot.
- [EvaMariaTG](https://github.com/EvaMariaTG) for EvaMaria Bot.

## Thanks to
- Thanks To Dan For His Awsome [Libary](https://github.com/pyrogram/pyrogram)
Expand Down
7 changes: 4 additions & 3 deletions plugins/pm_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@
BUTTONS = {}


@Client.on_message(filters.group & filters.text)
@Client.on_message(filters.group & filters.text & filters.private)
async def give_filter(client,message):
group_id = message.chat.id
name = message.text
user_id = message.chat.id

keywords = await get_filters(group_id)
keywords = await get_filters(group_id, user_id)
for keyword in reversed(sorted(keywords, key=len)):
pattern = r"( |^|[^\w])" + re.escape(keyword) + r"( |$|[^\w])"
if re.search(pattern, name, flags=re.IGNORECASE):
reply_text, btn, alert, fileid = await find_filter(group_id, keyword)
reply_text, btn, alert, fileid = await find_filter(group_id, user_id, keyword)

if reply_text:
reply_text = reply_text.replace("\\n", "\n").replace("\\t", "\t")
Expand Down