Skip to content

Commit

Permalink
[DEBUG]
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Jan 9, 2024
1 parent 9c489b0 commit 0ca0e56
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/commands/info/question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

},
};

0 comments on commit 0ca0e56

Please sign in to comment.