Skip to content

Commit

Permalink
Merge pull request #15 from TogetherCrew/feat/skip-create-message
Browse files Browse the repository at this point in the history
feat: Skipping the INTERACTION_RESPONSE.Create!
  • Loading branch information
cyri113 authored Jan 18, 2024
2 parents 004dab8 + 2216eca commit 069cb1f
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions celery_app/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
from tc_messageBroker.rabbit_mq.payload.discord_bot.chat_input_interaction import (
ChatInputCommandInteraction,
)
from tc_messageBroker.rabbit_mq.payload.discord_bot.interaction_response import (
InteractionResponse,
)
from tc_messageBroker.rabbit_mq.payload.payload import Payload
from tc_messageBroker.rabbit_mq.queue import Queue

Expand Down Expand Up @@ -48,22 +45,22 @@ def ask_question_auto_search(

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=chat_input_interaction,
data=InteractionResponse(
type=4,
data=InteractionCallbackData(
content="Processing your question ...", flags=64
),
),
).to_dict()
# create_interaction_content = Payload.DISCORD_BOT.INTERACTION_RESPONSE.Create(
# interaction=chat_input_interaction,
# data=InteractionResponse(
# type=4,
# data=InteractionCallbackData(
# content="Processing your question ...", flags=64
# ),
# ),
# ).to_dict()

logging.info(f"{prefix}Sending process question to discord-bot!")
job_send(
event=Event.DISCORD_BOT.INTERACTION_RESPONSE.CREATE,
queue_name=Queue.DISCORD_BOT,
content=create_interaction_content,
)
# logging.info(f"{prefix}Sending process question to discord-bot!")
# job_send(
# event=Event.DISCORD_BOT.INTERACTION_RESPONSE.CREATE,
# queue_name=Queue.DISCORD_BOT,
# content=create_interaction_content,
# )
logging.info(f"{prefix}Querying the data sources!")
# for now we have just the discord platform
response, source_nodes = query_multiple_source(
Expand Down

0 comments on commit 069cb1f

Please sign in to comment.