Add reply thread response

telegram_threading
Guillermo Rodriguez 2023-10-13 22:40:38 -03:00
parent 8a415b450f
commit b0e0d226d5
No known key found for this signature in database
GPG Key ID: EC3AB66D5D83B392
2 changed files with 17 additions and 5 deletions

View File

@ -305,6 +305,7 @@ class SkynetTelegramFrontend:
parse_mode='HTML' parse_mode='HTML'
) )
], ],
message_thread_id=status_msg.message_thread_id
) )
else: # txt2img else: # txt2img
@ -313,7 +314,8 @@ class SkynetTelegramFrontend:
caption=caption, caption=caption,
photo=png_img, photo=png_img,
reply_markup=build_redo_menu(), reply_markup=build_redo_menu(),
parse_mode='HTML' parse_mode='HTML',
message_thread_id=status_msg.message_thread_id
) )
return True return True

View File

@ -129,7 +129,11 @@ def create_handler_context(frontend: 'SkynetTelegramFrontend'):
# init new msg # init new msg
init_msg = 'started processing txt2img request...' init_msg = 'started processing txt2img request...'
status_msg = await bot.reply_to(message, init_msg) status_msg = await bot.reply_to(
message,
init_msg,
message_thread_id=message.message_thread_id
)
await db_call( await db_call(
'new_user_request', user.id, message.id, status_msg.id, status=init_msg) 'new_user_request', user.id, message.id, status_msg.id, status=init_msg)
@ -191,7 +195,11 @@ def create_handler_context(frontend: 'SkynetTelegramFrontend'):
# init new msg # init new msg
init_msg = 'started processing txt2img request...' init_msg = 'started processing txt2img request...'
status_msg = await bot.reply_to(message, init_msg) status_msg = await bot.reply_to(
message,
init_msg,
message_thread_id=message.message_thread_id
)
await db_call( await db_call(
'new_user_request', user.id, message.id, status_msg.id, status=init_msg) 'new_user_request', user.id, message.id, status_msg.id, status=init_msg)
@ -282,10 +290,12 @@ def create_handler_context(frontend: 'SkynetTelegramFrontend'):
init_msg = 'started processing redo request...' init_msg = 'started processing redo request...'
if is_query: if is_query:
status_msg = await bot.send_message(chat.id, init_msg) status_msg = await bot.send_message(
chat.id, init_msg, message_thread_id=message.message_thread_id)
else: else:
status_msg = await bot.reply_to(message, init_msg) status_msg = await bot.reply_to(
message, init_msg, message_thread_id=message.message_thread_id)
method = await db_call('get_last_method_of', user.id) method = await db_call('get_last_method_of', user.id)
prompt = await db_call('get_last_prompt_of', user.id) prompt = await db_call('get_last_prompt_of', user.id)