This commit is contained in:
parent
f865daaf3b
commit
40c48cb61a
10
index.js
10
index.js
|
|
@ -458,7 +458,10 @@ Example data object:
|
|||
}, 10 * 60 * 1000);
|
||||
let errCount = 0;
|
||||
function sendMessage() {
|
||||
channel.send(thisMsg).catch((err) => {
|
||||
channel.send(thisMsg).then((msg) => {
|
||||
// Message sent successfully. Note in the logs
|
||||
console.log(`${colors.cyan("[INFO]")} Sent message to ${channel.guild.name}/${channel.name} (${channel.guild.id}/${channel.id}). ${errCount}/3`);
|
||||
}).catch((err) => {
|
||||
console.error(err);
|
||||
}).then((msg) => {
|
||||
if (msg.channel.type === Discord.ChannelType.GuildAnnouncement) msg.crosspost();
|
||||
|
|
@ -534,7 +537,10 @@ Example data object:
|
|||
let errCount = 0;
|
||||
|
||||
function sendMessage() {
|
||||
user.send(thisMsg).catch((err) => {
|
||||
user.send(thisMsg).then((msg) => {
|
||||
// Message sent successfully. Note in the logs
|
||||
console.log(`${colors.cyan("[INFO]")} Sent message to ${user.tag} (${user.id}). ${errCount}/3`);
|
||||
}).catch((err) => {
|
||||
console.log(`${colors.yellow("[WARN]")} Failed to send message to ${user.tag} (${user.id})`);
|
||||
if (errCount < 3) {
|
||||
errCount++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue