discord_bot/commands/admin/send.js

16 lines
No EOL
518 B
JavaScript

module.exports = {
name: 'send',
description: 'Send a message to a specific channel',
admin: true,
execute({client, args}){
let channel = args[0];
let message = args.slice(1, args.length)
message = message.join(" ")
try{
client.channels.cache.get(channel).send(message)
}catch(err){
console.error(`An error occurred while trying to send a message to ${channel}`,err);
message.channel.send("An error occurred while trying to send a message to that channel.\nCheck console for details.");
}
}
}