mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04: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.Db.Models;
|
||||
using OneOf;
|
||||
using OneOf.Types;
|
||||
using StackExchange.Redis;
|
||||
using CommandInfo = Discord.Commands.CommandInfo;
|
||||
|
||||
@@ -500,8 +501,8 @@ public sealed class PatronageService
|
||||
if (!confData.IsEnabled)
|
||||
return default;
|
||||
|
||||
if (_creds.IsOwner(userId))
|
||||
return default;
|
||||
// if (_creds.IsOwner(userId))
|
||||
// return default;
|
||||
|
||||
// get user tier
|
||||
var patron = await GetPatronAsync(userId);
|
||||
@@ -558,7 +559,9 @@ public sealed class PatronageService
|
||||
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>(
|
||||
|
Reference in New Issue
Block a user