diff --git a/src/NadekoBot/Modules/Gambling/PlantPick/PlantPickService.cs b/src/NadekoBot/Modules/Gambling/PlantPick/PlantPickService.cs index 2c4e94fbd..cd9b5f372 100644 --- a/src/NadekoBot/Modules/Gambling/PlantPick/PlantPickService.cs +++ b/src/NadekoBot/Modules/Gambling/PlantPick/PlantPickService.cs @@ -16,7 +16,7 @@ namespace NadekoBot.Modules.Gambling.Services; public class PlantPickService : INService, IExecNoCommand { //channelId/last generation - public ConcurrentDictionary LastGenerations { get; } = new(); + public ConcurrentDictionary LastGenerations { get; } = new(); private readonly DbService _db; private readonly IBotStrings _strings; private readonly IImageCache _images; @@ -175,15 +175,15 @@ public class PlantPickService : INService, IExecNoCommand try { var config = _gss.Data; - var lastGeneration = LastGenerations.GetOrAdd(channel.Id, DateTime.MinValue); + var lastGeneration = LastGenerations.GetOrAdd(channel.Id, DateTime.MinValue.ToBinary()); var rng = new NadekoRandom(); if (DateTime.UtcNow - TimeSpan.FromSeconds(config.Generation.GenCooldown) - < lastGeneration) //recently generated in this channel, don't generate again + < DateTime.FromBinary(lastGeneration)) //recently generated in this channel, don't generate again return; var num = rng.Next(1, 101) + (config.Generation.Chance * 100); - if (num > 100 && LastGenerations.TryUpdate(channel.Id, DateTime.UtcNow, lastGeneration)) + if (num > 100 && LastGenerations.TryUpdate(channel.Id, DateTime.UtcNow.ToBinary(), lastGeneration)) { var dropAmount = config.Generation.MinAmount; var dropAmountMax = config.Generation.MaxAmount;