1
0
mirror of https://github.com/civsocit/olgram.git synced 2025-12-15 08:16:17 +00:00

second message option

This commit is contained in:
jjki3d
2024-02-17 03:52:37 +04:00
parent 82b68d1d9f
commit 0881c86349
8 changed files with 34 additions and 3 deletions

View File

@@ -160,7 +160,7 @@ async def handle_user_message(message: types.Message, super_chat_id: int, bot):
if bot.second_text:
send_auto = not await _redis.get(_last_message_uid(bot.pk, message.chat.id))
await _redis.setex(_last_message_uid(bot.pk, message.chat.id), 60 * 60 * 3, 1)
if send_auto:
if send_auto or bot.enable_always_second_message:
text_obj = await BotSecondMessage.get_or_none(bot=bot, locale=str(message.from_user.locale))
return SendMessage(chat_id=message.chat.id, text=text_obj.text if text_obj else bot.second_text,
parse_mode="HTML")