D
D
Dmitry2022-03-30 01:49:23
Python
Dmitry, 2022-03-30 01:49:23

How to remove text, user greeting in a group?

Tell me how to delete a message with a user greeting, for example, after 60 seconds.

@dp.message_handler(content_types=["new_chat_members"])
async def handler_new_member(message):
    first_name = message.new_chat_members[0].first_name
    await bot.send_message(message.chat.id, "✔ Благодарим Вас за подписку!0}".format(first_name), disable_notification=True)
    await message.delete()


Aiogram library.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitalii Price, 2022-03-30
@vitaliiprice

constant problems with message_auto_delete_timer (int) in aiogram.
I would do this:
the "Hello" button along with the message, and through the callback I would pass the deletion when pressed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question