editReply after deferReply don't works

console.log("hi1")
await interaction.editReply(`Pong! `)
console.log("hi2")
console.log("hi1")
await interaction.editReply(`Pong! `)
console.log("hi2")
- it's in an async function - it send heartebat - it log "hi1" but not "hi2" - it don't edit the reply - (before this there is a defer reply) - it don't log any rate-limit from client.ws.on("ratelimited")
2 Replies
d.js toolkit
d.js toolkit2y ago
- What's your exact discord.js npm list discord.js and node node -v version? - Post the full error stack trace, not just the top part! - Show your code! - Explain what exactly your issue is. - Not a discord.js issue? Check out #useful-servers. - Issue solved? Press the button!
Killer Boss Original
node v18.16.1 discordjs v14.11.0 yes i writed it wrong, it is ok in the code but there isn't a bot online on that network, or anything that use a webhook but is all offline... and the bot online don't have any interaction sorry i don't know but for example
curl -X POST --data '{"content": "test"}' --header "Content-Type:application/json" https://discord.com/api/webhooks/***/***/***
curl -X POST --data '{"content": "test"}' --header "Content-Type:application/json" https://discord.com/api/webhooks/***/***/***
works and return
x-ratelimit-limit: 5
x-ratelimit-remaining: 4
x-ratelimit-reset: 1689626262
x-ratelimit-reset-after: 1
x-ratelimit-limit: 5
x-ratelimit-remaining: 4
x-ratelimit-reset: 1689626262
x-ratelimit-reset-after: 1
and
client.rest.on('rateLimited', console.log)
client.rest.on('rateLimited', console.log)
didn't log anything a log, after 20 minutes, this is the full error:
/home/container/node_modules/@discordjs/rest/dist/index.js:640
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^
DiscordAPIError[50027]: Invalid Webhook Token
at handleErrors (/home/container/node_modules/@discordjs/rest/dist/index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:1021:23)
at async SequentialHandler.queueRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:862:14)
at async REST.request (/home/container/node_modules/@discordjs/rest/dist/index.js:1387:22)
at async InteractionWebhook.editMessage (/home/container/node_modules/discord.js/src/structures/Webhook.js:338:15)
at async ChatInputCommandInteraction.editReply (/home/container/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:158:17)
at async Object.execute (file:///home/container/build/interactions/commands/ping.js:8:9) {
requestBody: {
files: [],
json: {
content: 'Pong! ',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: { message: 'Invalid Webhook Token', code: 50027 },
code: 50027,
status: 401,
method: 'PATCH',
url: 'https://discord.com/api/v10/webhooks/***/***/messages/@original'
}
Node.js v18.16.1
/home/container/node_modules/@discordjs/rest/dist/index.js:640
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^
DiscordAPIError[50027]: Invalid Webhook Token
at handleErrors (/home/container/node_modules/@discordjs/rest/dist/index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:1021:23)
at async SequentialHandler.queueRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:862:14)
at async REST.request (/home/container/node_modules/@discordjs/rest/dist/index.js:1387:22)
at async InteractionWebhook.editMessage (/home/container/node_modules/discord.js/src/structures/Webhook.js:338:15)
at async ChatInputCommandInteraction.editReply (/home/container/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:158:17)
at async Object.execute (file:///home/container/build/interactions/commands/ping.js:8:9) {
requestBody: {
files: [],
json: {
content: 'Pong! ',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: { message: 'Invalid Webhook Token', code: 50027 },
code: 50027,
status: 401,
method: 'PATCH',
url: 'https://discord.com/api/v10/webhooks/***/***/messages/@original'
}
Node.js v18.16.1
Want results from more Discord servers?
Add your server