Skip to content

Commit

Permalink
Handle dangling uncaught Promise exception
Browse files Browse the repository at this point in the history
Not a huge issue, just annoying having it show up and clogging up
the terminal
Also fixed a bug where if the bot doesn't have access to a channel
it would bubble up an error, made it avoid that case instead
  • Loading branch information
Fox-Islam committed Mar 11, 2021
1 parent 88769c2 commit fb0ed1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/scripts/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ function ping(message) {
setTimeout(() => {
message
.reply(" what do you want?")
.then(() => {})
.catch(console.error);
message.channel.stopTyping();
}, 7000);
Expand Down Expand Up @@ -66,6 +65,8 @@ function unPin50thMsg(channel) {
});
});
}
}).catch(function (error) {
console.log(error);
});
}

Expand All @@ -75,6 +76,9 @@ function getAllChannels(client) {
client.channels
.fetch(chnl.id)
.then((fullChannel) => {
if (!fullChannel.members.get(client.user.id)) {
return;
}
if (fullChannel.type === "text") {
unPin50thMsg(fullChannel);
}
Expand Down

0 comments on commit fb0ed1b

Please sign in to comment.