File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77from pyrogram import Client , Emoji , Filters
88
9- MENTION = "[{}](tg://user?id={})"
10- MESSAGE = "{} Welcome to [Pyrogram](https://docs.pyrogram.ml/)'s group chat {}!"
9+ TARGET = "PyrogramChat" # Target chat. Can also be a list of multiple chat ids/usernames
10+ MENTION = "[{}](tg://user?id={})" # User mention markup
11+ MESSAGE = "{} Welcome to [Pyrogram](https://docs.pyrogram.ml/)'s group chat {}!" # Welcome message
1112
1213app = Client ("my_account" )
1314
1415
15- @app .on_message (Filters .chat ("PyrogramChat" ) & Filters .new_chat_members )
16+ # Filter in only new_chat_members updates generated in TARGET chat
17+ @app .on_message (Filters .chat (TARGET ) & Filters .new_chat_members )
1618def welcome (client , message ):
1719 # Build the new members list (with mentions) by using their first_name
1820 new_members = [MENTION .format (i .first_name , i .id ) for i in message .new_chat_members ]
You can’t perform that action at this time.
0 commit comments