File tree 1 file changed +18
-14
lines changed
1 file changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -301,21 +301,25 @@ export class ClassService {
301
301
}
302
302
303
303
const classes = this . getClasses ( categoryType ) ;
304
- for ( const classObj of classes ) {
305
- const [ , channel ] = classObj ;
306
-
307
- const currentPerms = channel . permissionOverwrites . cache . get ( author . id ) ;
308
- if ( currentPerms ) {
309
- // Bitfield is 0 for deny, 1 for allow
310
- if ( currentPerms . allow . equals ( BigInt ( this . _DENY_BITFIELD ) ) ) {
311
- continue ;
304
+ await Promise . all (
305
+ Array . from ( classes ) . map ( ( classObj ) => {
306
+ const [ , channel ] = classObj ;
307
+
308
+ const currentPerms = channel . permissionOverwrites . cache . get ( author . id ) ;
309
+ if ( currentPerms ) {
310
+ // Bitfield is 0 for deny, 1 for allow
311
+ if ( currentPerms . allow . equals ( BigInt ( this . _DENY_BITFIELD ) ) ) {
312
+ return ;
313
+ }
312
314
}
313
- }
314
- await channel . permissionOverwrites . create ( author . id , {
315
- VIEW_CHANNEL : false ,
316
- SEND_MESSAGES : false ,
317
- } ) ;
318
- }
315
+
316
+ return channel . permissionOverwrites . create ( author . id , {
317
+ VIEW_CHANNEL : false ,
318
+ SEND_MESSAGES : false ,
319
+ } ) ;
320
+ } )
321
+ ) ;
322
+
319
323
return `You have successfully been removed from the ${ categoryType } category.` ;
320
324
}
321
325
You can’t perform that action at this time.
0 commit comments