From d3a43152d286cb39f802e7a7be7b9edaab43b907 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Thu, 18 Jan 2024 15:51:37 +0330 Subject: [PATCH] fix: the right value for the INTERACTION_RESPONSE.Create! --- celery_app/tasks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/celery_app/tasks.py b/celery_app/tasks.py index c43e35c..841a02c 100644 --- a/celery_app/tasks.py +++ b/celery_app/tasks.py @@ -45,8 +45,11 @@ def ask_question_auto_search( """ prefix = f"COMMUNITY_ID: {community_id} | " logging.info(f"{prefix}Processing question!") + + interaction = json.loads(bot_given_info["content"]["interaction"]) + chat_input_interaction = ChatInputCommandInteraction.from_dict(interaction) create_interaction_content = Payload.DISCORD_BOT.INTERACTION_RESPONSE.Create( - interaction=bot_given_info, + interaction=chat_input_interaction, data=InteractionResponse( type=4, data=InteractionCallbackData( @@ -80,9 +83,6 @@ def ask_question_auto_search( "source_nodes": source_nodes_dict, } - interaction = json.loads(bot_given_info["content"]["interaction"]) - chat_input_interaction = ChatInputCommandInteraction.from_dict(interaction) - response_payload = Payload.DISCORD_BOT.INTERACTION_RESPONSE.Edit( interaction=chat_input_interaction, data=InteractionCallbackData(content=json.dumps(results)),