File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -337,18 +337,20 @@ private async Task<IEnumerable<ContextCheckAttribute>> CheckPermissionsAsync(Com
337
337
338
338
foreach ( var check in contextChecks )
339
339
{
340
- if ( check is HomeServerAttribute homeServerAttribute )
340
+ // if command requiring homes erver is used outside, fail the check
341
+ if ( check is HomeServerAttribute homeServerAttribute
342
+ && ( ctx . Channel . IsPrivate || ctx . Guild is null || ctx . Guild . Id != Program . cfgjson . ServerID )
343
+ )
341
344
{
342
- if ( ctx . Channel . IsPrivate || ctx . Guild is null || ctx . Guild . Id != Program . cfgjson . ServerID )
343
- {
344
- failedChecks . Add ( homeServerAttribute ) ;
345
- }
345
+ failedChecks . Add ( homeServerAttribute ) ;
346
346
}
347
347
348
348
if ( check is RequireHomeserverPermAttribute requireHomeserverPermAttribute )
349
349
{
350
- // Fail if guild member is null but this cmd does not work outside of the home server
351
- if ( member is null && ! requireHomeserverPermAttribute . WorkOutside )
350
+ // Fail if guild is wrong but this command does not work outside of the home server
351
+ if (
352
+ ( ctx . Channel . IsPrivate || ctx . Guild is null || ctx . Guild . Id != Program . cfgjson . ServerID )
353
+ && ! requireHomeserverPermAttribute . WorkOutside )
352
354
{
353
355
failedChecks . Add ( requireHomeserverPermAttribute ) ;
354
356
}
You can’t perform that action at this time.
0 commit comments