DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (D:\bots\scully\node_modules\@discordjs\rest\dist\index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (D:\bots\scully\node_modules\@discordjs\rest\dist\index.js:826:23)
at async _REST.request (D:\bots\scully\node_modules\@discordjs\rest\dist\index.js:1266:22)
at async ButtonInteraction.update (D:\bots\scully\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:233:5)
at async safelyReplyToInteraction (D:\bots\scully\node_modules\@sapphire\discord.js-utilities\dist\cjs\index.cjs:675:7)
at async _PaginatedMessage.handleCollect (D:\bots\scully\node_modules\@sapphire\discord.js-utilities\dist\cjs\index.cjs:1741:11) {
requestBody: {
files: [],
json: {
type: 7,
data: {
content: 'This is the second page',
tts: false,
nonce: undefined,
embeds: [
{
title: undefined,
description: undefined,
url: undefined,
timestamp: '2024-03-08T02:49:43.491Z',
color: 16711680,
fields: undefined,
author: undefined,
thumbnail: undefined,
image: undefined,
video: undefined,
footer: [Object]
}
],
components: [
{ type: 1, components: [Array] },
{ type: 1, components: [Array] }
],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
}
},
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1215491616278716497/aW50ZXJhY3Rpb246MTIxNTQ5MTYxNjI3ODcxNjQ5Nzoxd1pNZjRJaWFKeHI0cElGR0NaMHlaNnBQSHB4aVhPZjRNTmIxUnh0eDBJNHdkb2lIODVadklJeENhV2hpRHBqSGdza1B5NlVWZEVLNkRkOU9sM2FuU1d1RFhSRFhpTmJic2g0WUp2eHRreG81alBCQmpyN1RLMzk1aWU2Qk9kWg/callback'
}DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (D:\bots\scully\node_modules\@discordjs\rest\dist\index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (D:\bots\scully\node_modules\@discordjs\rest\dist\index.js:826:23)
at async _REST.request (D:\bots\scully\node_modules\@discordjs\rest\dist\index.js:1266:22)
at async ButtonInteraction.update (D:\bots\scully\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:233:5)
at async safelyReplyToInteraction (D:\bots\scully\node_modules\@sapphire\discord.js-utilities\dist\cjs\index.cjs:675:7)
at async _PaginatedMessage.handleCollect (D:\bots\scully\node_modules\@sapphire\discord.js-utilities\dist\cjs\index.cjs:1741:11) {
requestBody: {
files: [],
json: {
type: 7,
data: {
content: 'This is the second page',
tts: false,
nonce: undefined,
embeds: [
{
title: undefined,
description: undefined,
url: undefined,
timestamp: '2024-03-08T02:49:43.491Z',
color: 16711680,
fields: undefined,
author: undefined,
thumbnail: undefined,
image: undefined,
video: undefined,
footer: [Object]
}
],
components: [
{ type: 1, components: [Array] },
{ type: 1, components: [Array] }
],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
}
},
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1215491616278716497/aW50ZXJhY3Rpb246MTIxNTQ5MTYxNjI3ODcxNjQ5Nzoxd1pNZjRJaWFKeHI0cElGR0NaMHlaNnBQSHB4aVhPZjRNTmIxUnh0eDBJNHdkb2lIODVadklJeENhV2hpRHBqSGdza1B5NlVWZEVLNkRkOU9sM2FuU1d1RFhSRFhpTmJic2g0WUp2eHRreG81alBCQmpyN1RLMzk1aWU2Qk9kWg/callback'
}const { PaginatedMessage } = require('@sapphire/discord.js-utilities');
const { Command } = require('@sapphire/framework');
const { EmbedBuilder } = require('discord.js');
const { sendLoadingMessage } = require('../../lib/utils');
class UserCommand extends Command {
constructor(context, options) {
super(context, {
...options,
aliases: ['pm'],
description: 'A command that uses paginated messages.',
generateDashLessAliases: true
});
}
async messageRun(message) {
const response = await sendLoadingMessage(message);
const paginatedMessage = new PaginatedMessage({
template: new EmbedBuilder()
.setColor('#FF0000')
// Be sure to add a space so this is offset from the page numbers!
.setFooter({ text: ' footer after page numbers' })
});
paginatedMessage
.addPageEmbed((embed) =>
embed //
.setDescription('This is the first page')
.setTitle('Page 1')
)
.addPageBuilder((builder) =>
builder //
.setContent('This is the second page')
.setEmbeds([new EmbedBuilder().setTimestamp()])
);
await paginatedMessage.run(response, message.author);
return response;
}
}
module.exports = {
UserCommand
};const { PaginatedMessage } = require('@sapphire/discord.js-utilities');
const { Command } = require('@sapphire/framework');
const { EmbedBuilder } = require('discord.js');
const { sendLoadingMessage } = require('../../lib/utils');
class UserCommand extends Command {
constructor(context, options) {
super(context, {
...options,
aliases: ['pm'],
description: 'A command that uses paginated messages.',
generateDashLessAliases: true
});
}
async messageRun(message) {
const response = await sendLoadingMessage(message);
const paginatedMessage = new PaginatedMessage({
template: new EmbedBuilder()
.setColor('#FF0000')
// Be sure to add a space so this is offset from the page numbers!
.setFooter({ text: ' footer after page numbers' })
});
paginatedMessage
.addPageEmbed((embed) =>
embed //
.setDescription('This is the first page')
.setTitle('Page 1')
)
.addPageBuilder((builder) =>
builder //
.setContent('This is the second page')
.setEmbeds([new EmbedBuilder().setTimestamp()])
);
await paginatedMessage.run(response, message.author);
return response;
}
}
module.exports = {
UserCommand
};Join the Discord to ask follow-up questions and connect with the community
Sapphire is a next-gen object-oriented Discord.js bot framework.
2,286 Members
Join