Dominik
Dominik
DIAdiscord.js - Imagine an app
Created by Dominik on 1/23/2024 in #djs-questions
Expected token to be set for this request, but none was present
I started to use discordjs/rest for some of my stuff to have less api calls in my overall code. One of those being the following
await this.client.rest.post(
`/channels/${message?.channelId}/messages/${apiReturnValue.id}/threads`,
{
body: {
name: `${[
date.getFullYear(),
date.getMonth() + 1,
date.getDate(),
].join("/")} - Daily Message`,
auto_archive_duration: "1440",
},
},
);
await this.client.rest.post(
`/channels/${message?.channelId}/messages/${apiReturnValue.id}/threads`,
{
body: {
name: `${[
date.getFullYear(),
date.getMonth() + 1,
date.getDate(),
].join("/")} - Daily Message`,
auto_archive_duration: "1440",
},
},
);
It should in theory work just fine but for some reason its complaining about a token not being set. I tried to use client.rest.setToken but that doesnt seem to work either. Is there something im missing?
23 replies
DIAdiscord.js - Imagine an app
Created by Dominik on 10/21/2023 in #djs-questions
Not sending webhooks in docker
Hey so I recently dockerized my bot to make hosting easier and ever since that none of my webhook requests go through to discord and don't get posted. Is there a port I need to open or anything I am missing?
13 replies
DIAdiscord.js - Imagine an app
Created by Dominik on 8/12/2023 in #djs-questions
.showModal is not a function
I use modals a bit and every once in the while I get the error TypeError: interaction.showModal is not a function now the modal still works like normal and there is no visual sign of an error etc. Is there any reason to why this could happen?
11 replies
DIAdiscord.js - Imagine an app
Created by Dominik on 8/10/2023 in #djs-questions
Ram issues with new version
Soo I run a rather small bot that used around 600mb of ram before the most recent version so discord.js. Now with the new version that usage has gone 3/4x out of nowhere, so I wanted to ask if there is any issue related to this already known?
15 replies
DIAdiscord.js - Imagine an app
Created by Dominik on 2/19/2023 in #djs-questions
Webhook not creating/sending
So I have a daily message system that creates a webhook if there is none or sends a embed message if the webhook exists. This all works fine in my best bot but when I try to move it to production it wont send/create the webhooks on most server. Around 200 servers use that system but the bot only made 20webhooks so far. It also cant be a permissions issue as I gave the bot admin on my dev server and it still didn't send/create anything. There is also no error logged which is weird. This whole error is really annoying as I'm not sure how to fix it so I'm looking for help here: Code for the daily message system: https://gist.github.com/mezotv/ccd892a7500334f54c68df31929c2e8e Code for our webhook handler: https://gist.github.com/mezotv/2635d066c28c246020fe2890128708d3 Full code (if needed): https://github.com/Would-You-Bot/Would-You/tree/debugCommandPlusTranslateFix
104 replies