mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
change: added ending date for givaway as a timestamp tag
fixed: fixed an issue with flag translates
This commit is contained in:
@@ -122,12 +122,15 @@ public sealed partial class FlagTranslateService : IReadyExecutor, INService
|
||||
if (!_supportedFlags.TryGetValue(code, out var lang))
|
||||
return;
|
||||
|
||||
if (!_msgLangs.Add((reaction.MessageId, lang)))
|
||||
if (_msgLangs.Contains((reaction.MessageId, lang)))
|
||||
return;
|
||||
|
||||
var result = await _cache.GetAsync(CdKey(reaction.UserId));
|
||||
if (result.TryPickT0(out _, out _))
|
||||
return;
|
||||
|
||||
if (!_msgLangs.Add((reaction.MessageId, lang)))
|
||||
return;
|
||||
|
||||
await _cache.AddAsync(CdKey(reaction.UserId), true, TimeSpan.FromSeconds(5));
|
||||
|
||||
|
@@ -38,6 +38,8 @@ public partial class Utility
|
||||
eb
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.giveaway_started))
|
||||
.AddField(GetText(strs.lasts_until), TimestampTag.FromDateTime(DateTime.UtcNow.Add(duration)), true)
|
||||
// .AddField(GetText(strs.winners_count), "1", true)
|
||||
.WithFooter($"id: {new kwum(id).ToString()}");
|
||||
|
||||
await startingMsg.AddReactionAsync(new Emoji(GiveawayService.GiveawayEmoji));
|
||||
|
Reference in New Issue
Block a user