[entertainment] use thread safe random, update /roll number range

This commit is contained in:
Andriy
2023-01-17 23:13:06 +02:00
parent 98b1e2f0f7
commit 83296efbb7
5 changed files with 49 additions and 7 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ using System.Text.RegularExpressions;
using System.Threading.Tasks;
using BotFramework.Attributes;
using BotFramework.Enums;
using Kruzya.TelegramBot.Core;
using Kruzya.TelegramBot.Core.Data;
using Microsoft.Extensions.Logging;
using Telegram.Bot;
@@ -15,7 +16,7 @@ namespace West.Entertainment.Handler.Fun
{
protected override TimeSpan Cooldown => TimeSpan.Zero;
public Bayan(CoreContext db, ILogger<Bayan> logger) : base(db, logger) { }
public Bayan(CoreContext db, ILogger<Bayan> logger, ThreadSafeRandom rng) : base(db, logger, rng) { }
protected override Regex AnimationMatch
=> new("^баян$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);