H
H
HappyMen2019-06-29 02:07:37
PHP
HappyMen, 2019-06-29 02:07:37

Write a message when the user entered the TELEGRAM BOT group?

I'm using the library - https://github.com/TelegramBot/Api/
I can't figure out how to make it so that if a user enters a group chat, the bot would send a message "Hello"
And if possible, fix its sent message
The bot already has admin rights

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sound901, 2019-06-30
@saund901

@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))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question