CraftyMaelyss
DIAdiscord.js - Imagine an app
•Created by CraftyMaelyss on 9/11/2023 in #djs-questions
My Bot won't post a .gif file from it's Assets folder
It's been a long time since I worked on a bot last and I've been revisiting my old bot that runs my server. I've updated the API, downloaded all the up to date NPM and discord.js files and my bot is sending messages just like normal.
The issue I'm experiencing is that my bot will not send .gif or any images from it's Assets folder. I first started with the old code from when I first made the bot:
if (message.content == "Major Ruin"
{
message.reply("This is Major Ruin!", { files: ["./Assets/Gifs/MajorRuin.gif"] } );
{
Then after doing some more google searching and finding some servers, someone pointed me towards the discord documents which I have gone through the page a couple of times but I'm having trouble understanding how to use it. The problem is, whenever I was learning to code discord bots or any form of coding, there would be examples to help show you how to write it out correctly to teach you how to properly code it.
This is the document that was sent to me:
https://old.discordjs.dev/#/docs/discord.js/main/class/AttachmentBuilder?scrollTo=s-from
My bot's folder structure is like this:
User/source/repos/CraftyMaelyss/TheWotNot/Source_Code/Assets/Gifs
Whenever I try to learn how to write this new code, I'm finding that there's not many examples being shown for either beginners or very rusty individuals like myself. What is the proper way to write out the AttachmentBuilder when using it in your code? I'm a visual learner and I'm getting errors because I'm basically guessing how to write this because I can't find any examples of how to do so.6 replies