Unknown interaction with paginated message custom actions

Hi there, I'm using sapphire's paginated messages from @sapphire/discord.js-utilities. Before adding custom actions, a stop button worked fine. I recently set custom actions to:
leaderboard.setActions([
{
emoji: Emoji.LeftChevron,
customId: "x-previous",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: ({ handler }) => {
if (handler.index === 0) {
handler.index = handler.pages.length - 1;
} else {
--handler.index;
}
},
},
{
emoji: Emoji.RightChevron,
customId: "x-next",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: ({ handler }) => {
if (handler.index === handler.pages.length - 1) {
handler.index = 0;
} else {
++handler.index;
}
},
},
{
emoji: Emoji.Cross,
customId: "x-stop",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: ({ collector }) => {
collector.stop("stopped");
},
},
]);
leaderboard.setActions([
{
emoji: Emoji.LeftChevron,
customId: "x-previous",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: ({ handler }) => {
if (handler.index === 0) {
handler.index = handler.pages.length - 1;
} else {
--handler.index;
}
},
},
{
emoji: Emoji.RightChevron,
customId: "x-next",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: ({ handler }) => {
if (handler.index === handler.pages.length - 1) {
handler.index = 0;
} else {
++handler.index;
}
},
},
{
emoji: Emoji.Cross,
customId: "x-stop",
type: ComponentType.Button,
style: ButtonStyle.Secondary,
run: ({ collector }) => {
collector.stop("stopped");
},
},
]);
Now, when I click the stop button. I get a djs error in the console:
DiscordAPIError[10062]: Unknown interaction
// other stack trace paths here

at async safelyReplyToInteraction (file:///Users/net-tech-/Developer/anime-interlink-typescript/node_modules/.pnpm/@[email protected]/node_modules/@sapphire/discord.js-utilities/dist/index.mjs:664:7)
DiscordAPIError[10062]: Unknown interaction
// other stack trace paths here

at async safelyReplyToInteraction (file:///Users/net-tech-/Developer/anime-interlink-typescript/node_modules/.pnpm/@[email protected]/node_modules/@sapphire/discord.js-utilities/dist/index.mjs:664:7)
Am I not stopping the paginator correctly?
4 Replies
b1nzee
b1nzee2y ago
I've never used the paginated message plugin But out of curiosity, is this an ephemeral message you're using?
net-tech-
net-tech-OP2y ago
No bump
WhacK
WhacK2y ago
I don’t have a good answer for you but this happens to my bot on an ephemeral paginated message and two or more users running the same command at the same time. The command shows a shops inventory at the time.
Favna
Favna17mo ago
make sure the stop button has the same custom id as the built in one, or just don't add a custom stop button at all and use the default one
Want results from more Discord servers?
Add your server