mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2024-10-02 20:13:13 +00:00
dev: Small cleanup of gamestatusevent
This commit is contained in:
parent
2a528cb3d6
commit
f66c105cc0
1 changed files with 7 additions and 10 deletions
|
@ -27,17 +27,13 @@ public class GameStatusEvent : ICurrencyEvent
|
|||
|
||||
private readonly string _code;
|
||||
|
||||
private readonly char[] _sneakyGameStatusChars = Enumerable.Range(48, 10)
|
||||
.Concat(Enumerable.Range(65, 26))
|
||||
.Concat(Enumerable.Range(97, 26))
|
||||
.Select(x => (char)x)
|
||||
.ToArray();
|
||||
|
||||
private readonly object _stopLock = new();
|
||||
|
||||
private readonly object _potLock = new();
|
||||
private readonly IMessageSenderService _sender;
|
||||
|
||||
private static readonly NadekoRandom _rng = new NadekoRandom();
|
||||
|
||||
public GameStatusEvent(
|
||||
DiscordSocketClient client,
|
||||
ICurrencyService cs,
|
||||
|
@ -58,7 +54,8 @@ public class GameStatusEvent : ICurrencyEvent
|
|||
_opts = opt;
|
||||
_sender = sender;
|
||||
// generate code
|
||||
_code = new(_sneakyGameStatusChars.Shuffle().Take(5).ToArray());
|
||||
|
||||
_code = new kwum(_rng.Next(1_000_000, 10_000_000)).ToString();
|
||||
|
||||
_t = new(OnTimerTick, null, Timeout.InfiniteTimeSpan, TimeSpan.FromSeconds(2));
|
||||
if (_opts.Hours > 0)
|
||||
|
|
Loading…
Reference in a new issue