Python
17
Вклад в тег
import asyncio
from contextlib import suppress
from aiogram import types
from aiogram.utils.exceptions import (MessageToEditNotFound, MessageCantBeEdited, MessageCantBeDeleted,
MessageToDeleteNotFound)
async def delete_message(message: types.Message, sleep_time: int = 0):
await asyncio.sleep(sleep_time)
with suppress(MessageCantBeDeleted, MessageToDeleteNotFound):
await message.delete()
msg = await message.reply("Я удалюсь через 30 секунд")
asyncio.create_task(delete_message(msg, 30)
@dp.message_handler(text='Текст')
async def test(message: types.Message):
await bot.send_message(message.from_user.id,reply_markup=keybord)
@dp.message_handler(content_type=['text'])
async def test(message: types.Message):
if message.text = "Текст":
await bot.send_message(message.from_user.id,reply_markup=keybord)
await bot.send_message(message.from_user.id,reply_markup=keybord)
await message.answer("Хмм", reply_markup=keybord )