how to put make the discord bot put an image? Node.js
how to put make the discord bot put an image? Node.js
Voters
Squirrel777
Add a folder called images
, put an image in it, and add the following code:
client.on('message', msg => { if (msg.content.startsWith ('!image')) { msg.channel.send('An Image:', {files: ["./images/yourImage.png"]}); } });
Then type !image
in your discord server and it will appear!
LukeArwolf
can you help me put an image in this code?
const Discord = require('discord.js');
module.exports.run = async (client, message, args) => {
message.channel.send('test');
console.log('test');
};
Is this in an embed, or just a normal image?
@SixBeeps normal image
@LukeArwolf Something like this:
@SixBeeps needs to be .png?
@SixBeeps it didn't work
@LukeArwolf It should be any image that Discord supports (png/jpg)
Show me the code that doesn't work.
@SixBeeps I want to put an image after the text "test"
const Discord = require('discord.js');
module.exports.run = async (client, message, args) => {
message.channel.send('test');
console.log('test');
};
@LukeArwolf
@SixBeeps THANK YOU VERY MUCH. helped a lot <3 <3 <3
now it worked <3 <3