File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,17 +102,18 @@ export const ZookeepCommand: Command<ApplicationCommandType.User> = {
102102 }
103103 const applicableChannel = interaction . channel ;
104104
105+ // if the command is being done in a private or special channel...
105106 if (
106107 applicableChannel &&
107- ! applicableChannel . permissionsFor ( guild . roles . everyone ) . has ( "ViewChannel" )
108+ ! applicableChannel
109+ . permissionsFor ( guild . roles . everyone )
110+ . has ( "SendMessages" )
108111 ) {
109112 // send it in general instead
110113 const generalChannel = guild . channels . cache . get ( config . channels . general ) ;
111114 if (
112115 generalChannel ?. isTextBased ( ) &&
113- generalChannel
114- . permissionsFor ( interaction . client . user )
115- ?. has ( "SendMessages" )
116+ generalChannel . permissionsFor ( interaction . user . id ) ?. has ( "SendMessages" )
116117 ) {
117118 await interaction . reply ( {
118119 content : `Zookept successfully executed! Posting the result in <#${ config . channels . general } >.` ,
You can’t perform that action at this time.
0 commit comments