aa battery
aa battery
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by aa battery on 9/16/2023 in #djs-questions
Cannot edit interaction after modal input
Ok so here is my problem, I want to achieve something like so: Step 1: send interaction with button Step 2: user clicks button Step 3: modal shows and user enters stuff Step 4: after submit edit the original interaction Problem is, editReply() and updateMessage() doesn't let me do that (replying to the modal works) and discord api returns with a "Unknown Webhook" error:
DiscordAPIError[10015]: Unknown Webhook
// i cut this part off to save word count
at async Client.<anonymous> (C:\Users\mt\Visual Studio Code\testBot\handler.js:93:17) {
requestBody: {
files: undefined,
json: { content: '', embeds: [Array], components: [Array] }
},
rawError: { message: 'Unknown Webhook', code: 10015 },
code: 10015,
status: 404,
method: 'PATCH',
url: 'https://discord.com/api/v10/webhooks/bleh/bleh/messages/@original'
}
DiscordAPIError[10015]: Unknown Webhook
// i cut this part off to save word count
at async Client.<anonymous> (C:\Users\mt\Visual Studio Code\testBot\handler.js:93:17) {
requestBody: {
files: undefined,
json: { content: '', embeds: [Array], components: [Array] }
},
rawError: { message: 'Unknown Webhook', code: 10015 },
code: 10015,
status: 404,
method: 'PATCH',
url: 'https://discord.com/api/v10/webhooks/bleh/bleh/messages/@original'
}
Is there a way to achieve step 4 as defined?
52 replies
DIAdiscord.js - Imagine an app
Created by aa battery on 9/14/2023 in #djs-questions
Unable to use updateMessage() on a message that has already used updateMessage()
So I have this modal that when it is submitted, it modifies the message that had the button to show the modal to say "Loading..." while I have some stuff running, but then if I want to use updateMessage() on that message it wont work and would give me this:
DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (C:\Users\mt\Documents\me stuff\prog\Visual Studio Code\genshinBot\node_modules\@discordjs\rest\dist\index.js:687:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\mt\Documents\me stuff\prog\Visual Studio Code\genshinBot\node_modules\@discordjs\rest\dist\index.js:786:23)
at async _REST.request (C:\Users\mt\Documents\me stuff\prog\Visual Studio Code\genshinBot\node_modules\@discordjs\rest\dist\index.js:1218:22)
at async InteractionsAPI.reply (C:\Users\mt\Documents\me stuff\prog\Visual Studio Code\genshinBot\node_modules\@discordjs\core\dist\index.js:1602:5)
at async Object.runModal (C:\Users\mt\Documents\me stuff\prog\Visual Studio Code\genshinBot\commands\login.js:62:17)
at async Client.<anonymous> (C:\Users\mt\Documents\me stuff\prog\Visual Studio Code\genshinBot\handler.js:93:17) {
requestBody: { files: undefined, json: { type: 4, data: [Object] } },
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/ blah blah blah
}
DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (C:\Users\mt\Documents\me stuff\prog\Visual Studio Code\genshinBot\node_modules\@discordjs\rest\dist\index.js:687:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\mt\Documents\me stuff\prog\Visual Studio Code\genshinBot\node_modules\@discordjs\rest\dist\index.js:786:23)
at async _REST.request (C:\Users\mt\Documents\me stuff\prog\Visual Studio Code\genshinBot\node_modules\@discordjs\rest\dist\index.js:1218:22)
at async InteractionsAPI.reply (C:\Users\mt\Documents\me stuff\prog\Visual Studio Code\genshinBot\node_modules\@discordjs\core\dist\index.js:1602:5)
at async Object.runModal (C:\Users\mt\Documents\me stuff\prog\Visual Studio Code\genshinBot\commands\login.js:62:17)
at async Client.<anonymous> (C:\Users\mt\Documents\me stuff\prog\Visual Studio Code\genshinBot\handler.js:93:17) {
requestBody: { files: undefined, json: { type: 4, data: [Object] } },
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/ blah blah blah
}
8 replies
DIAdiscord.js - Imagine an app
Created by aa battery on 9/14/2023 in #djs-questions
Error running a select menu inside a modal (not sure if that's really the issue)
I have this action row with a text box and a select menu which i put inside a modal that is activated with a button:
static cookieField = new ActionRowBuilder(
{
components: [
new TextInputBuilder({
custom_id: "cookieField",
label: "Hoyolab cookie string",
style: TextInputStyle.Short,
placeholder: "_MHYUUID=c19fda-29...",
required: true
}),
new StringSelectMenuBuilder({
custom_id: "serverPicker",
max_values: 1,
options: [
new StringSelectMenuOptionBuilder({
label: "American server", value: "1", emoji: { name: "πŸ‡ΊπŸ‡Έ" }
}),
new StringSelectMenuOptionBuilder({
label: "Europian server", value: "2", emoji: { name: "πŸ‡ͺπŸ‡Ί" }
}),
new StringSelectMenuOptionBuilder({
label: "Asian server", value: "3", emoji: { name: "🏳️" }
}),
new StringSelectMenuOptionBuilder({
label: "HW/TW/MO server", value: "4", emoji: { name: "πŸ‘Ž"}
})
]
})
]
}
);
static cookieField = new ActionRowBuilder(
{
components: [
new TextInputBuilder({
custom_id: "cookieField",
label: "Hoyolab cookie string",
style: TextInputStyle.Short,
placeholder: "_MHYUUID=c19fda-29...",
required: true
}),
new StringSelectMenuBuilder({
custom_id: "serverPicker",
max_values: 1,
options: [
new StringSelectMenuOptionBuilder({
label: "American server", value: "1", emoji: { name: "πŸ‡ΊπŸ‡Έ" }
}),
new StringSelectMenuOptionBuilder({
label: "Europian server", value: "2", emoji: { name: "πŸ‡ͺπŸ‡Ί" }
}),
new StringSelectMenuOptionBuilder({
label: "Asian server", value: "3", emoji: { name: "🏳️" }
}),
new StringSelectMenuOptionBuilder({
label: "HW/TW/MO server", value: "4", emoji: { name: "πŸ‘Ž"}
})
]
})
]
}
);
5 replies