@app.on_message(filters.private & filters.user != ADMIN) def something(app, message): doSomething()
Asked
Active
Viewed 334 times
1 Answers
0
I Expect ADMIN is the chat_id of Admin
ADMIN=849816969
@app.on_message(filters.private & ~filters.user(ADMIN))
def something(app, message):
doSomething()
If More than one admin
ADMIN=[849816969, 599815969, 488681569]
@app.on_message(filters.private & ~filters.user(ADMIN))
def something(app, message):
doSomething()
here ~ work as not operator
you can find it in Pyrogram Docs: https://docs.pyrogram.org/topics/use-filters#combining-filters
Use ~ to invert a filter (behaves like the not operator).
Use & and | to merge two filters (behave like and, or operators respectively).

DeekshithSH
- 173
- 2
- 8