mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
fix: selfhosters shouldn't get a feature limit about reaction roles anymore
This commit is contained in:
@@ -316,14 +316,23 @@ public sealed class PatronageService
|
||||
private TypedKey<int> CreateKey(LimitedFeatureName key, ulong userId)
|
||||
=> new($"limited_feature:{key}:{userId}");
|
||||
|
||||
private QuotaLimit _emptyQuota = new QuotaLimit()
|
||||
private readonly QuotaLimit _emptyQuota = new QuotaLimit()
|
||||
{
|
||||
Quota = 0,
|
||||
QuotaPeriod = QuotaPer.PerDay,
|
||||
};
|
||||
|
||||
private readonly QuotaLimit _infiniteQuota = new QuotaLimit()
|
||||
{
|
||||
Quota = -1,
|
||||
QuotaPeriod = QuotaPer.PerDay,
|
||||
};
|
||||
|
||||
public async Task<QuotaLimit> GetUserLimit(LimitedFeatureName name, ulong userId)
|
||||
{
|
||||
if (!_pConf.Data.IsEnabled)
|
||||
return _infiniteQuota;
|
||||
|
||||
var maybePatron = await GetPatronAsync(userId);
|
||||
|
||||
if (maybePatron is not { } patron)
|
||||
|
Reference in New Issue
Block a user