mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-03 16:24:27 -05:00 
			
		
		
		
	Fixed a patron bug which didn't let patrons execute patron commands in non-patron servers
This commit is contained in:
		@@ -3,6 +3,7 @@ using LinqToDB.EntityFrameworkCore;
 | 
				
			|||||||
using NadekoBot.Common.ModuleBehaviors;
 | 
					using NadekoBot.Common.ModuleBehaviors;
 | 
				
			||||||
using NadekoBot.Db.Models;
 | 
					using NadekoBot.Db.Models;
 | 
				
			||||||
using OneOf;
 | 
					using OneOf;
 | 
				
			||||||
 | 
					using OneOf.Types;
 | 
				
			||||||
using StackExchange.Redis;
 | 
					using StackExchange.Redis;
 | 
				
			||||||
using CommandInfo = Discord.Commands.CommandInfo;
 | 
					using CommandInfo = Discord.Commands.CommandInfo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -500,8 +501,8 @@ public sealed class PatronageService
 | 
				
			|||||||
        if (!confData.IsEnabled)
 | 
					        if (!confData.IsEnabled)
 | 
				
			||||||
            return default;
 | 
					            return default;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (_creds.IsOwner(userId))
 | 
					        // if (_creds.IsOwner(userId))
 | 
				
			||||||
            return default;
 | 
					        //     return default;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // get user tier
 | 
					        // get user tier
 | 
				
			||||||
        var patron = await GetPatronAsync(userId);
 | 
					        var patron = await GetPatronAsync(userId);
 | 
				
			||||||
@@ -558,7 +559,9 @@ public sealed class PatronageService
 | 
				
			|||||||
            data.TryGetValue(QuotaPer.PerMonth, out var monthly) ? monthly : null
 | 
					            data.TryGetValue(QuotaPer.PerMonth, out var monthly) ? monthly : null
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return quotaCheckResult.Match(_ => default, x => x);
 | 
					        return quotaCheckResult.Match<OneOf<Success, InsufficientTier, QuotaLimit>>(
 | 
				
			||||||
 | 
					            _ => new Success(),
 | 
				
			||||||
 | 
					            x => x);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private bool TryGetTierDataOrLower<T>(
 | 
					    private bool TryGetTierDataOrLower<T>(
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user