File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -570,7 +570,7 @@ function handleGenerically(error, channel) {
570
570
}
571
571
console . error ( error . toString ( ) ) ;
572
572
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 ) ) {
574
574
const messageToSend = "Sorry, an error occured."
575
575
channel . send ( messageToSend )
576
576
. catch ( error => console . error ( `An error occured while sending message "${ messageToSend } "!\n\nFull details:\n${ error . toString ( ) } ` ) ) ;
@@ -800,7 +800,7 @@ function respondToNonCommands(message) {
800
800
throw new TypeError ( "Incorrect type for respondToNonCommands argument!" ) ;
801
801
}
802
802
const channel = message . channel ;
803
- if ( hasMentionForUser ( message , client . user ) && canSendMessages ) {
803
+ if ( hasMentionForUser ( message , client . user ) && clientHasPermissionInChannel ( permissions . sendMessages , channel ) ) {
804
804
let messageToSend = getRandomFromArray ( response . mentioned ) ;
805
805
if ( developmentEnvironment && ! isSentInDevelopmentGuild ( message ) ) {
806
806
messageToSend = botUnavailableString ;
You can’t perform that action at this time.
0 commit comments