Add error message if send command fails

This commit is contained in:
SileNce5k 2023-08-09 09:20:36 +02:00
parent 845f415e5a
commit a06221d275
No known key found for this signature in database
GPG key ID: 961132EB78C8915F

View file

@ -6,6 +6,11 @@ module.exports = {
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.");
}
}
}