mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
dev: small cleanup, removed qodana
This commit is contained in:
@@ -19,16 +19,11 @@ public sealed class PatronageService
|
||||
public int Priority
|
||||
=> int.MinValue;
|
||||
|
||||
private static readonly PatronTier[] _tiers = Enum.GetValues<PatronTier>();
|
||||
|
||||
private readonly PatronageConfig _pConf;
|
||||
private readonly DbService _db;
|
||||
private readonly DiscordSocketClient _client;
|
||||
private readonly ISubscriptionHandler _subsHandler;
|
||||
|
||||
private static readonly TypedKey<long> _quotaKey
|
||||
= new($"quota:last_hourly_reset");
|
||||
|
||||
private readonly IBotCache _cache;
|
||||
private readonly IBotCredsProvider _creds;
|
||||
private readonly IMessageSenderService _sender;
|
||||
@@ -133,19 +128,19 @@ public sealed class PatronageService
|
||||
// user is charged again for this month
|
||||
// if his sub would end in teh future, extend it by one month.
|
||||
// if it's not, just add 1 month to the last charge date
|
||||
var count = await ctx.GetTable<PatronUser>()
|
||||
.Where(x => x.UniquePlatformUserId
|
||||
== subscriber.UniquePlatformUserId)
|
||||
.UpdateAsync(old => new()
|
||||
{
|
||||
UserId = subscriber.UserId,
|
||||
AmountCents = subscriber.Cents,
|
||||
LastCharge = lastChargeUtc,
|
||||
ValidThru = old.ValidThru >= todayDate
|
||||
// ? Sql.DateAdd(Sql.DateParts.Month, 1, old.ValidThru).Value
|
||||
? old.ValidThru.AddMonths(1)
|
||||
: dateInOneMonth,
|
||||
});
|
||||
await ctx.GetTable<PatronUser>()
|
||||
.Where(x => x.UniquePlatformUserId
|
||||
== subscriber.UniquePlatformUserId)
|
||||
.UpdateAsync(old => new()
|
||||
{
|
||||
UserId = subscriber.UserId,
|
||||
AmountCents = subscriber.Cents,
|
||||
LastCharge = lastChargeUtc,
|
||||
ValidThru = old.ValidThru >= todayDate
|
||||
// ? Sql.DateAdd(Sql.DateParts.Month, 1, old.ValidThru).Value
|
||||
? old.ValidThru.AddMonths(1)
|
||||
: dateInOneMonth,
|
||||
});
|
||||
|
||||
|
||||
dbPatron.UserId = subscriber.UserId;
|
||||
|
Reference in New Issue
Block a user