Skip to content

Commit

Permalink
[DEBUG]
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Jan 18, 2024
1 parent 6ae0310 commit b649573
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/commands/info/question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default {

async execute(interaction: ChatInputCommandInteraction_broker) {
try {
logger.info('Question!!!!!!!!!!!')
// TogetherCrew-Leads: 983364577096003604 TogetherCrew-Contributors: 983364691692748832
if (!(interaction.member?.roles.cache.has("983364577096003604") || interaction.member?.roles.cache.has("983364691692748832"))) {
return await interactionService.createInteractionResponse(interaction, { type: 4, data: { content: 'You do not have the required role to use this command!', flags: 64 } })
Expand All @@ -25,7 +24,6 @@ export default {
const processedInteraction = handleBigInts(serializedInteraction);
const cleanInteraction = removeCircularReferences(processedInteraction); // Pass processedInteraction here
const serializedData = JSON.stringify(cleanInteraction, null, 2);
logger.debug({ serializedData })
RabbitMQ.publish(RabbitMQQueue.HIVEMIND, Event.HIVEMIND.INTERACTION_CREATED, { interaction: serializedData });
} catch (error) {
logger.error({ command: 'question', error }, 'is failed');
Expand Down
8 changes: 7 additions & 1 deletion src/rabbitmq/events/interactionResponseCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ const logger = parentLogger.child({ module: `${Event.DISCORD_BOT.INTERACTION_RES
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function handleInteractionResponseCreate(msg: any) {
try {
logger.info({ msg, event: Event.DISCORD_BOT.INTERACTION_RESPONSE.CREATE }, 'is running');
logger.info({ msg, event: Event.DISCORD_BOT.INTERACTION_RESPONSE.CREATE, }, 'is running');
const interaction: ChatInputCommandInteraction_broker = JSON.parse(msg?.content.interaction);
const data: InteractionResponse = JSON.parse(msg?.content.data);

console.log(interaction)

console.log(data)

await interactionService.createInteractionResponse(interaction, data);
logger.info({ msg, event: Event.DISCORD_BOT.INTERACTION_RESPONSE.CREATE }, 'is done');
} catch (error) {
console.log(error)
logger.error({ msg, event: Event.DISCORD_BOT.INTERACTION_RESPONSE.CREATE, error }, 'is failed');
}
}

0 comments on commit b649573

Please sign in to comment.