Answer the question
In order to leave comments, you need to log in
How to catch the event adding a bot to the chat?
Hello Can you please tell me how to catch the event adding a bot to a group?
@dp.message_handler(content_types=['????'])
async def newschat(message: types.Message):
await message.answer(f"Спасибо что добавили в чат!")
Answer the question
In order to leave comments, you need to log in
@dp.message_handler(content_types=['new_chat_members'])
async def send_welcome(message: types.Message):
bot_obj = await bot.get_me()
bot_id = bot_obj.id
for chat_member in message.new_chat_members:
if chat_member.id == bot_id:
await message.reply("Hi!\nI'm EchoBot!\nPowered by aiogram.")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question