1message.channel.send("Testing message.", { files: ["./images/headpat1.png"] });
2//pls like if this worked!
3
4// The file variable has to be an array
5// even if you want to send one file.
6// But because it is an array you can send multiples files.
7
8// For exemple:
9message.channel.send("Testing message.", {
10 files: [
11 "./images/headpat1.png",
12 "./images/headpat2.png"
13 ]
14});
15
1//For Discord.Js v12
2
3const { MessageAttachment } = require("discord.js");
4
5const file = new MessageAttachment("your_file.png");
6//for a file on projects root if your file is in another subfolder just type the relative path to it
7
8message.channel.send(file);