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) {
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 ;
You can’t perform that action at this time.
0 commit comments