Skip to content

Commit 2d83a88

Browse files
committed
I overused find and replace...
1 parent 901b8cd commit 2d83a88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ function handleGenerically(error, channel) {
570570
}
571571
console.error(error.toString());
572572
console.trace();
573-
if (!(client === undefined || client === null || channel === undefined || channel === null) && canSendMessages) {
573+
if (!(client === undefined || client === null || channel === undefined || channel === null) && clientHasPermissionInChannel(permissions.sendMessages, channel)) {
574574
const messageToSend = "Sorry, an error occured."
575575
channel.send(messageToSend)
576576
.catch(error => console.error(`An error occured while sending message "${messageToSend}"!\n\nFull details:\n${error.toString()}`));
@@ -800,7 +800,7 @@ function respondToNonCommands(message) {
800800
throw new TypeError("Incorrect type for respondToNonCommands argument!");
801801
}
802802
const channel = message.channel;
803-
if (hasMentionForUser(message, client.user) && canSendMessages) {
803+
if (hasMentionForUser(message, client.user) && clientHasPermissionInChannel(permissions.sendMessages, channel)) {
804804
let messageToSend = getRandomFromArray(response.mentioned);
805805
if (developmentEnvironment && !isSentInDevelopmentGuild(message)) {
806806
messageToSend = botUnavailableString;

0 commit comments

Comments
 (0)