I reused a snipe command code to make this fetch command but that's not really my issue here.
I'm trying to fetch a message from a channel and post it in a designated channel, for example: Grab the message in X, and post it in Y. If that makes sense, all I have so far are:
const Discord = require('discord.js');
module.exports = class FetchCommand extends BaseCommand {
constructor() {
super('fetch', 'fun', []);
}
async run(client, message, args) {
const msg = client.snipes.get(message.channel.id);
if (!msg) return message.channel.send('There are no messages to fetch.');
const fetchEmbed = new Discord.MessageEmbed()
.setAuthor(msg.author.tag, msg.author.displayAvatarURL())
.setDescription(msg.content)
.setTimestamp()
message.channel.send(fetchEmbed);
}
}
Help is very appreciated!
PS: As of right now, it fetches the messages from the channel it is running the command it. If I sent a message in X channel, and run the command in X channel it would fetch the message in the X channel. My goal is trying to fetch a message from a channel and post it in another channel.