The image is not sent
Hello. I would like that when a person joins my discord server a welcome image generated with canvas is sent in the welcome channel. Problem: the text is sent in the channel but not the image. Moreover, no error is returned in Visual Studio code.
16 Replies
- 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 staffUnknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Files in embeds should be attached via the message option object and referenced in the embed:
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
I'm sorry I don't know the JS actually the code given was generated via chatGPT
If I've understood correctly, all I have to do is attachment://${attachment.name}`); right?
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Can you just tell me if my reasoning is right please?
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Ho okey I think I just understood
Ah well no I tried with
new: AttachmentBuilder('./welcome_image.png', { name: 'welcome_image.png' }), but it doesn't work
new: AttachmentBuilder('./welcome_image.png', { name: 'welcome_image.png' }), but it doesn't work
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Look, I don't know, like I told you, I don't know JS. I was just trying to make a bot that works with the means at my disposal.
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Have you look at the discord js guide about canvas ?
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Oh nan I had not seen this guide
The guide is for people who want to create an order. I haven't figured out how to attach a canvas-generated file to my code. I'm sorry if I sound silly.
There's really something I don't understand, but in my code it doesn't work.
Bah nique ca mère je vais me débrouiller puisque personne ne veux m'aider ici
Oui oui j'en parlerais a mon cheval