Skip to content

Commit c8770d2

Browse files
Update pmpermit.py
1 parent 831d457 commit c8770d2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

userbot/plugins/pmpermit.py

+19
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,26 @@ async def on_new_private_message(event):
106106
# userbot's should not reply to other userbot's
107107
# https://core.telegram.org/bots/faq#why-doesn-39t-my-bot-see-messages-from-other-bots
108108
return
109+
sender = await bot.get_entity(chat_id)
109110

111+
if chat_id == bot.uid:
112+
113+
# don't log Saved Messages
114+
115+
return
116+
117+
if sender.bot:
118+
119+
# don't log bots
120+
121+
return
122+
123+
if sender.verified:
124+
125+
# don't log verified accounts
126+
127+
return
128+
110129
if any([x in event.raw_text for x in ("/start", "1", "2", "3", "4", "5")]):
111130
return
112131

0 commit comments

Comments
 (0)