mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Made .timely use timestamp tags and fixed a bug
This commit is contained in:
@@ -126,13 +126,15 @@ public partial class Gambling : GamblingModule<GamblingService>
|
||||
|
||||
if (_cache.AddTimelyClaim(ctx.User.Id, period) is { } rem)
|
||||
{
|
||||
await ReplyErrorLocalizedAsync(strs.timely_already_claimed(rem.ToString(@"dd\d\ hh\h\ mm\m\ ss\s")));
|
||||
var now = DateTime.UtcNow;
|
||||
var relativeTag = TimestampTag.FromDateTime(now.Add(rem), TimestampTagStyles.Relative);
|
||||
await ReplyErrorLocalizedAsync(strs.timely_already_claimed(relativeTag));
|
||||
return;
|
||||
}
|
||||
|
||||
var result = await _ps.TryGetFeatureLimitAsync(_timelyKey, ctx.User.Id, 0);
|
||||
|
||||
val = (int)(val * (1 + (result.Quota * 0.01f)));
|
||||
val = (int)(val * (1 + (result.Quota! * 0.01f)));
|
||||
|
||||
await _cs.AddAsync(ctx.User.Id, val, new("timely", "claim"));
|
||||
|
||||
|
Reference in New Issue
Block a user