Add async

This commit is contained in:
Rykov7
2023-10-28 22:34:20 +03:00
parent 588949e2b4
commit e8dbbfe5c5
2 changed files with 11 additions and 18 deletions
+3 -10
View File
@@ -59,22 +59,15 @@ async def remove_stan_quote(message: types.Message):
if message.reply_to_message and message.reply_to_message.text:
quote = html.escape(message.reply_to_message.text)
already_exist = session.query(Quote).filter_by(text=quote,
chat_id=message.chat.id).first()
already_exist = session.query(Quote).filter_by(text=quote, chat_id=message.chat.id).first()
if already_exist:
session.delete(already_exist)
session.commit()
await bot.send_message(
message.chat.id,
f"✅ <b>Удалил</b>\n └ <i>{quote}</i>",
)
await bot.send_message(message.chat.id, f"✅ <b>Удалил</b>\n └ <i>{quote}</i>",)
await bot.delete_message(message.chat.id, message.id)
else:
await bot.send_message(
message.chat.id,
f"⛔️ <b>Нет такого</b>\n └ <i>{quote}</i>",
)
await bot.send_message(message.chat.id, f"⛔️ <b>Нет такого</b>\n └ <i>{quote}</i>",)
@bot.message_handler(func=is_nongrata)