mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-10-23 17:36:26 +02:00
changing add group to new member
parent
66e4895f4b
commit
c5efe80ab4
1 changed files with 4 additions and 4 deletions
|
@ -32,7 +32,7 @@ It is also a follow-up to the page [Introduction to the API](https://github.com/
|
|||
* [Other useful stuff](#other-useful-stuff)
|
||||
+ [Generate flag emojis from country codes](#generate-flag-emojis-from-country-codes)
|
||||
+ [Map a Slot Machine Dice value to the corresponding symbols](#map-a-slot-machine-dice-value-to-the-corresponding-symbols)
|
||||
+ [Get the add group message](#get-the-add-group-message)
|
||||
+ [Get the new members group message](#get-the-new-members-message)
|
||||
+ [Exclude forwarded channel posts in discussion groups from MessageHandlers](#exclude-forwarded-channel-posts-in-discussion-groups-from-messagehandlers)
|
||||
+ [Exclude messages from anonymous admins](#exclude-messages-from-anonymous-admins)
|
||||
- [Advanced snippets](#advanced-snippets)
|
||||
|
@ -472,11 +472,11 @@ slot_machine_value = {
|
|||
}
|
||||
```
|
||||
|
||||
#### Get the add group message
|
||||
#### Get the new members message
|
||||
```python
|
||||
def add_group(update, context):
|
||||
def add_group(update: Update, context: CallbackContext):
|
||||
for member in update.message.new_chat_members:
|
||||
update.message.reply_text("{username} add group".format(username=member.username))
|
||||
update.message.reply_text("{member.full_name} just joined the group")
|
||||
|
||||
add_group_handle = MessageHandler(Filters.status_update.new_chat_members, add_group)
|
||||
dispatcher.add_handler(add_group_handle)
|
||||
|
|
Loading…
Reference in a new issue