Attaching files

I have two bots with similar base code. I have one bot that can attach files a specific local directory, so i know thats fine. The other wont, it also attaches as a file but i assume thats a symptom not a cause (i assume because there is an attachment error) I have message content turned on in Developers portal, gateway intents are identical. the role of the new bot is set as Admin so it should have permissions. what am i missing? This is the most current version of discord.js 14.20
No description
No description
No description
16 Replies
d.js toolkit
d.js toolkit6mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Oroton
OrotonOP6mo ago
No description
Amgelo
Amgelo6mo ago
are you sure the file is there and it's not empty? are you using ts or js, and if ts, how are you running it? also intents are completely irrelevant the message content intent is for reading messages, not sending them in general intents allow you to receive or request information, not send it
Oroton
OrotonOP6mo ago
hmm, i read somewhere on stack exchange someone was having a similar problem and this was a solution albiet it was a very old solution.
Amgelo
Amgelo6mo ago
they were probably referring to fetching attachments, not sending them
Oroton
OrotonOP6mo ago
I mean the code is identical between the bots right? and when i put in a wrong image name to test it throws an error saying file does not exist
Amgelo
Amgelo6mo ago
intents have always behaved the same make sure it's not an issue with the file itself then
Oroton
OrotonOP6mo ago
they are sending the same file though
Amgelo
Amgelo6mo ago
can double-check just in case ah, I thought you had two folders with the same code are you running the same code with two different tokens or something?
Oroton
OrotonOP6mo ago
No description
Oroton
OrotonOP6mo ago
no i'm rewriting this bot i essentially have one bot that does a bit, and i rewriting this bot with 14.20 and want to remove features from one bot into a standalone bot
Oroton
OrotonOP6mo ago
No description
Oroton
OrotonOP6mo ago
yes two different tokens
Amgelo
Amgelo6mo ago
why did you use ping in one bot and animate in the other, if they're the exact same code :Thonk:
Oroton
OrotonOP6mo ago
ping was the command i used in the first bot, but i didn't want to call it ping in the second bot interesting. seems like one line of code (which runs a function) stops it i'll have to further investigate this
Oroton
OrotonOP6mo ago
Ok so this is probably has an issue with priority i guess, Even if the file exists, i can't overwrite it with a new file. and fetch the existing or the old if the share the same name. If i change the name it's fine. For now instead of saving the file, i am just going to buffer it and use that instead of saving locally. So unrelated to everything i thought it was.. Cheers
No description

Did you find this page helpful?