diff --git a/plugins/pm_filter.py b/plugins/pm_filter.py index 7030ce0..81deb55 100644 --- a/plugins/pm_filter.py +++ b/plugins/pm_filter.py @@ -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")