Hi, so the idea is I have certain commands that use a paginated message, and I want to log the user's result to my logs channel to check if it's working correctly.
I log command usage in a method like the code below, and I realise my app crashes very frequently with a DiscordAPIError[10062]: Unknown interaction, especially when i try to navigate the pages myself with the select menu. The node.js process then exits with error code 1.
I suspect that the duplicate pagination (one to the user, one to the logs channel) is causing the issue, so I disabled the logging and I encounter no more crashes.
I'd really like to fix this if possible though, and I can't seeem to pinpoint what went wrong. Any help appreciated. Thanks!
public static async logPagination(pagination: PaginatedMessage) {
const commandLogsChannel = CommandLogger._getCommandLogsChannel();
const msg = await commandLogsChannel.send({
embeds: [
new EmbedBuilder()
.setDescription("Running a paginated message here.")
]
});
const botOwner = container.owner.user;
return pagination.clone().run(msg, botOwner);
}
Edit: if it helps, this is how i invoke the method.
public override async chatInputRun(interaction: ChatInputCommandInteraction) {
/* here is the logic to generate paginatedMessage */
void CommandLogger.logPagination(paginatedMessage);
return paginatedMessage.run(interaction);
}