Answer the question
In order to leave comments, you need to log in
How to properly read new group members?
I made a bot in the group so that it greets new people. I use telebot.
I have this code:
@bot.message_handler(content_types=["new_chat_members"])
def handler_new_member(message):
user_name = message.from_user.first_name
bot.send_message(message.chat.id, "Добро пожаловать, {0}!".format(user_name))
Answer the question
In order to leave comments, you need to log in
@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))
@dp.message_handler(content_types=["new_chat_members"])
async def handler_new_member(message):
first_name = message.new_chat_members[0].first_name
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question