L
L
lommaks2019-08-30 19:29:19
Chats
lommaks, 2019-08-30 19:29:19

How to make a bots greeting in a Telegram group chat?

Good afternoon, tell me how to implement so that when a new member is added in a group chat, the message
Hello, {username}!
Welcome to chat
Let's get acquainted!
We currently have {number of members} in our chat

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danil K., 2019-09-02
@Danya_Violet

@bot.message_handler(content_types=["new_chat_members"])
def handler_new_member(message):
    user_name = message.new_chat_member.first_name
    bot.send_message(message.chat.id, "Добро пожаловать, {0}!".format(user_name))

source

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question