Kasino game access control (#25)

* Blackjack

* sync

* Kasino game enable/disable control
This commit is contained in:
CrackmaticSoftware
2026-01-07 23:09:56 +01:00
committed by GitHub
parent 47771a0f4c
commit 7e3ba4e641
11 changed files with 294 additions and 9 deletions

View File

@@ -40,9 +40,24 @@ public class LimboCommand : ICommand
{
decimal limboNumber; //user number
var settings = await SettingsProvider.GetMultipleValuesAsync([
BuiltIn.Keys.KasinoLimboCleanupDelay, BuiltIn.Keys.KiwiFarmsGreenColor, BuiltIn.Keys.KiwiFarmsRedColor
BuiltIn.Keys.KasinoGameDisabledMessageCleanupDelay,
BuiltIn.Keys.KasinoLimboCleanupDelay, BuiltIn.Keys.KasinoLimboEnabled,
BuiltIn.Keys.KiwiFarmsGreenColor, BuiltIn.Keys.KiwiFarmsRedColor
]);
// Check if limbo is enabled
var limboEnabled = (settings[BuiltIn.Keys.KasinoLimboEnabled]).ToBoolean();
if (!limboEnabled)
{
var gameDisabledCleanupDelay= TimeSpan.FromMilliseconds(settings[BuiltIn.Keys.KasinoGameDisabledMessageCleanupDelay].ToType<int>());
await botInstance.SendChatMessageAsync(
$"{user.FormatUsername()}, limbo is currently disabled.",
true, autoDeleteAfter: gameDisabledCleanupDelay);
return;
}
var cleanupDelay = TimeSpan.FromMilliseconds(settings[BuiltIn.Keys.KasinoLimboCleanupDelay].ToType<int>());
if (!arguments.TryGetValue("amount", out var amount))
{
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, not enough arguments. !limbo <wager>",