Add error message if send command fails
This commit is contained in:
parent
845f415e5a
commit
a06221d275
1 changed files with 6 additions and 1 deletions
|
@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue