File tree Expand file tree Collapse file tree
src/components/moderation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,7 +217,15 @@ export default class Modlogs extends BotComponent {
217217 if ( channel . isDMBased ( ) || ! channel . parent ) {
218218 return false ;
219219 }
220- return [ this . wheatley . categories . staff . id , this . wheatley . categories . staff_logs . id ] . includes ( channel . parent . id ) ;
220+ const min_viewable_permissions = this . wheatley . guild . roles . cache
221+ . mapValues ( role => channel . permissionsFor ( role ) . bitfield )
222+ . reduce ( ( accumulator , value ) => {
223+ if ( value & Discord . PermissionFlagsBits . ViewChannel ) {
224+ return accumulator & value ;
225+ }
226+ return accumulator ;
227+ } , Discord . PermissionsBitField . All ) ;
228+ return ( min_viewable_permissions & Discord . PermissionFlagsBits . ModerateMembers ) != 0n ;
221229 }
222230
223231 async modlogs ( command : TextBasedCommand , user : Discord . User ) {
You can’t perform that action at this time.
0 commit comments