Barnuss
Barnuss
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
Gotcha, thank you
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
Ahh yes I’ll use the built in WebhookClient, thanks for the help though :)
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
But I might just consider a whole new approach to this, something without rest
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
Sorry, line 201 is the one starting with await discordApi.patch(...)
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
It's a button press event
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
Biut thanks
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
Hmmm yeah, I intend it to be a user app though and that would lead to permission issues
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
if that makes sense lol
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
the original message has a button that replies with an ephemeral containing yet another button, which edits the original
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
Alrighty: client.on("interactionCreate", async (interaction) => { if (!interaction.isButton()) return; if (interaction.customId !== "single_guess_confirm") return; try { // ... const discordApi = new REST().setToken(client.token); await discordApi.patch(Routes.webhookMessage(client.user.id, token), { files: [{ data: finalMapImage, name: "map.png" }], body: { // not relevant, embed with buttons }, }); // ... } catch (error) { console.error(error); } });
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
it's awaited and in try catch
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
but still, i don't get how the server crashes :OMEGAlul:
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
thanks
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
could be the case actually, since it is a rare one
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/22/2024 in #djs-questions
REST Crash
Sure! The error is: home/container/node_modules/@discordjs/rest/dist/index.js:730 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:730:13)  at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async SequentialHandler.runRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:1133:23) at async SequentialHandler.queueRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:963:14) at async _REST.request (/home/container/node_modules/@discordjs/rest/dist/index.js:1278:22) at async addUser (/home/container/commands/multiGame.js:201:7) { requestBody: { files: undefined, json: { embeds: [ // not relevant ] } }, rawError: { message: 'Invalid Webhook Token', code: 50027 }, code: 50027, status: 401, method: 'PATCH', url: 'https://discord.com/api/v10/webhooks/1225076420980641882/aW50ZXJhY3Rpb246MTI2NDkwNzc2NTI5MDEwNjkwMDpOQnREa2lkSEdER2dmSnU0VkdPN1pRbWJrZDF0dUhhY2wxTTg0SHRzQVphTXMxMmxDTENtcE1LdVZpM0xGUUtkaDdqRHBSbWh4WnpuU0pVeEdDVGd5OENabUhDa2NJSlZLVVcxejJzQUJpbVVpZmdmQ2lUN0hLbWFMdXNjVGNkQg/messages/@original' }
24 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/5/2024 in #djs-questions
Edit Interaction Reply
Sounds good, thanks
10 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/5/2024 in #djs-questions
Edit Interaction Reply
But if there's no other solution, ty
10 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/5/2024 in #djs-questions
Edit Interaction Reply
Hmmm yeah, and that becomes an issue if the bot doesn't have access to the given channel
10 replies
DIAdiscord.js - Imagine an app
Created by Barnuss on 7/5/2024 in #djs-questions
Edit Interaction Reply
Thanks! And if the button is not on the message I want to edit, is there a way to essentially fetch an interaction and then edit its reply?
10 replies