#PaginatedMessage unknown interaction

1 messages · Page 1 of 1 (latest)

tropic canopy
#

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);
}
daring basinBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

sour orbit
#

This will never work. You cannot have 2 things on 1 interaction like that.

Why log every action of the user and not just the errors though?

Also the process shouldn't exit outright on a simple error. This suggests your error handling is borked. That's a different problem though.