From 0ca0e56fad2863d25b9d358a8dc1941b1dbbdc56 Mon Sep 17 00:00:00 2001 From: Behzad Rabiei <53224485+Behzad-rabiei@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:37:07 +0330 Subject: [PATCH] [DEBUG] --- src/commands/info/question.ts | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/commands/info/question.ts b/src/commands/info/question.ts index 0a63cbf1..0bb50dc3 100644 --- a/src/commands/info/question.ts +++ b/src/commands/info/question.ts @@ -15,15 +15,22 @@ export default { .setRequired(true)), async execute(interaction: ChatInputCommandInteraction_broker) { - // 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 } }) + try { + logger.debug('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 } }) + } + const serializedInteraction = interactionService.constructSerializableInteraction(interaction); + 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'); + } - const serializedInteraction = interactionService.constructSerializableInteraction(interaction); - 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 }); + }, }; \ No newline at end of file