Skip to content

Commit

Permalink
fix: the right value for the INTERACTION_RESPONSE.Create!
Browse files Browse the repository at this point in the history
  • Loading branch information
amindadgar committed Jan 18, 2024
1 parent b906fe0 commit d3a4315
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions celery_app/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)),
Expand Down

0 comments on commit d3a4315

Please sign in to comment.