mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Kasino game access control (#25)
* Blackjack * sync * Kasino game enable/disable control
This commit is contained in:
committed by
GitHub
parent
47771a0f4c
commit
7e3ba4e641
@@ -45,10 +45,23 @@ public class Planes : ICommand
|
||||
CancellationToken ctx)
|
||||
{
|
||||
var settings = await SettingsProvider.GetMultipleValuesAsync([
|
||||
BuiltIn.Keys.KasinoGameDisabledMessageCleanupDelay, BuiltIn.Keys.KasinoPlanesEnabled,
|
||||
BuiltIn.Keys.KasinoPlanesCleanupDelay, BuiltIn.Keys.KasinoPlanesRandomRiggeryEnabled,
|
||||
BuiltIn.Keys.KasinoPlanesTargetedRiggeryEnabled, BuiltIn.Keys.KasinoPlanesTargetedRiggeryVictims
|
||||
]);
|
||||
|
||||
// Check if planes is enabled
|
||||
var planesEnabled = (settings[BuiltIn.Keys.KasinoPlanesEnabled]).ToBoolean();
|
||||
if (!planesEnabled)
|
||||
{
|
||||
var gameDisabledCleanupDelay= TimeSpan.FromMilliseconds(settings[BuiltIn.Keys.KasinoGameDisabledMessageCleanupDelay].ToType<int>());
|
||||
await botInstance.SendChatMessageAsync(
|
||||
$"{user.FormatUsername()}, planes is currently disabled.",
|
||||
true, autoDeleteAfter: gameDisabledCleanupDelay);
|
||||
return;
|
||||
}
|
||||
var cleanupDelay = TimeSpan.FromMilliseconds(settings[BuiltIn.Keys.KasinoPlanesCleanupDelay].ToType<int>());
|
||||
|
||||
var logger = LogManager.GetCurrentClassLogger();
|
||||
if (!arguments.TryGetValue("amount", out var amount))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user