Barnuss
Explore posts from serversDIAdiscord.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 [90m(/home/container/[39mnode_modules/[4m@discordjs[24m/rest/dist/index.js:730:13[90m)[39m
[90m at process.processTicksAndRejections (node:internal/process/task_queues:95:5)[39m
at async SequentialHandler.runRequest [90m(/home/container/[39mnode_modules/[4m@discordjs[24m/rest/dist/index.js:1133:23[90m)[39m
at async SequentialHandler.queueRequest [90m(/home/container/[39mnode_modules/[4m@discordjs[24m/rest/dist/index.js:963:14[90m)[39m
at async _REST.request [90m(/home/container/[39mnode_modules/[4m@discordjs[24m/rest/dist/index.js:1278:22[90m)[39m
at async addUser [90m(/home/container/[39mcommands/multiGame.js:201:7[90m)[39m {
requestBody: {
files: [90mundefined[39m,
json: {
embeds: [
// not relevant
]
}
},
rawError: { message: [32m'Invalid Webhook Token'[39m, code: [33m50027[39m },
code: [33m50027[39m,
status: [33m401[39m,
method: [32m'PATCH'[39m,
url: [32m'https://discord.com/api/v10/webhooks/1225076420980641882/aW50ZXJhY3Rpb246MTI2NDkwNzc2NTI5MDEwNjkwMDpOQnREa2lkSEdER2dmSnU0VkdPN1pRbWJrZDF0dUhhY2wxTTg0SHRzQVphTXMxMmxDTENtcE1LdVZpM0xGUUtkaDdqRHBSbWh4WnpuU0pVeEdDVGd5OENabUhDa2NJSlZLVVcxejJzQUJpbVVpZmdmQ2lUN0hLbWFMdXNjVGNkQg/messages/@original'[39m
}
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