It's me again..
Alright so:
I'm trying to make a command that will warn users they joined a wrong server, But when I run the command, I get the Cannot send an empty msg error..
Really, any help would be appreciated!
const Discord = require("discord.js")
module.exports.run = async (client, message, args, err) => {
const embed = new Discord.MessageEmbed().setTitle('Hey!').setDescription('We think you have our server mistaken. etc etc')
if (!args[0]) return message.reply('Who?', { allowedMentions: { repliedUser: false } });
const member = message.mentions.members.first() || await message.guild.members.fetch(args[0]).catch(e => {
check = true;
return message.reply('Can\'t find specefied member! Provide a valid ID, or mention ig lol.', { allowedMentions: { repliedUser: false } });
});
message.channel.send(embed).catch(err)
message.channel.send(`${member}`)
}
Error:
DiscordAPIError: Cannot send an empty message
at RequestHandler.execute (C:\Users\stupk\Desktop\Holo\node_modules\discord.js\src\rest\RequestHandler.js:298:13)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async RequestHandler.push (C:\Users\stupk\Desktop\Holo\node_modules\discord.js\src\rest\RequestHandler.js:50:14) {
method: 'post',
path: '/channels/843567563648139317/messages',
code: 50006,
httpStatus: 400,
requestData: {
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined
},
files: []
}
}