mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
change: added ending date for givaway as a timestamp tag
fixed: fixed an issue with flag translates
This commit is contained in:
@@ -8,6 +8,7 @@ public sealed class GiveawayModel
|
|||||||
public ulong MessageId { get; set; }
|
public ulong MessageId { get; set; }
|
||||||
public ulong ChannelId { get; set; }
|
public ulong ChannelId { get; set; }
|
||||||
public string Message { get; set; }
|
public string Message { get; set; }
|
||||||
|
public int Winners { get; set; }
|
||||||
|
|
||||||
public IList<GiveawayUser> Participants { get; set; } = new List<GiveawayUser>();
|
public IList<GiveawayUser> Participants { get; set; } = new List<GiveawayUser>();
|
||||||
public DateTime EndsAt { get; set; }
|
public DateTime EndsAt { get; set; }
|
||||||
|
@@ -122,12 +122,15 @@ public sealed partial class FlagTranslateService : IReadyExecutor, INService
|
|||||||
if (!_supportedFlags.TryGetValue(code, out var lang))
|
if (!_supportedFlags.TryGetValue(code, out var lang))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!_msgLangs.Add((reaction.MessageId, lang)))
|
if (_msgLangs.Contains((reaction.MessageId, lang)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var result = await _cache.GetAsync(CdKey(reaction.UserId));
|
var result = await _cache.GetAsync(CdKey(reaction.UserId));
|
||||||
if (result.TryPickT0(out _, out _))
|
if (result.TryPickT0(out _, out _))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!_msgLangs.Add((reaction.MessageId, lang)))
|
||||||
|
return;
|
||||||
|
|
||||||
await _cache.AddAsync(CdKey(reaction.UserId), true, TimeSpan.FromSeconds(5));
|
await _cache.AddAsync(CdKey(reaction.UserId), true, TimeSpan.FromSeconds(5));
|
||||||
|
|
||||||
|
@@ -38,6 +38,8 @@ public partial class Utility
|
|||||||
eb
|
eb
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithTitle(GetText(strs.giveaway_started))
|
.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()}");
|
.WithFooter($"id: {new kwum(id).ToString()}");
|
||||||
|
|
||||||
await startingMsg.AddReactionAsync(new Emoji(GiveawayService.GiveawayEmoji));
|
await startingMsg.AddReactionAsync(new Emoji(GiveawayService.GiveawayEmoji));
|
||||||
|
@@ -1135,5 +1135,7 @@
|
|||||||
"no_last_queued_found": "No last queued track found.",
|
"no_last_queued_found": "No last queued track found.",
|
||||||
"wrongsong_success": "Oops! Wrong song removed: {0}",
|
"wrongsong_success": "Oops! Wrong song removed: {0}",
|
||||||
"server_not_found": "Server not found.",
|
"server_not_found": "Server not found.",
|
||||||
"server_color_set": "Successfully set a new server color."
|
"server_color_set": "Successfully set a new server color.",
|
||||||
|
"lasts_until": "Lasts Until",
|
||||||
|
"winners_count": "Winners"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user