mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-06-15 16:55:18 -04:00
Add switch to disable Cecil
Also oops I accidentally committed my horrible CSV hack for quotes previously. Oh well.
This commit is contained in:
@@ -38,6 +38,16 @@ public class CecilCommand : ICommand
|
||||
}
|
||||
|
||||
var cleanupDelay = TimeSpan.FromSeconds(15);
|
||||
var settings = await SettingsProvider.GetMultipleValuesAsync([BuiltIn.Keys.KasinoCecilEnabled]);
|
||||
|
||||
var cecilEnabled = settings[BuiltIn.Keys.KasinoCecilEnabled].ToBoolean();
|
||||
if (!cecilEnabled)
|
||||
{
|
||||
await botInstance.ReplyToUser(message,
|
||||
$"{user.FormatUsername()}, Cecil is currently disabled.",
|
||||
true, autoDeleteAfter: cleanupDelay);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!arguments.TryGetValue("bet", out var amount)) //if user just enters !keno
|
||||
{
|
||||
@@ -61,14 +71,10 @@ public class CecilCommand : ICommand
|
||||
return;
|
||||
}
|
||||
|
||||
double difficulty;
|
||||
var difficulty = 1.0;
|
||||
|
||||
double result;
|
||||
if (!arguments.TryGetValue("difficulty", out var diff))
|
||||
{
|
||||
difficulty = 1;
|
||||
}
|
||||
else
|
||||
if (arguments.TryGetValue("difficulty", out var diff))
|
||||
{
|
||||
difficulty = Convert.ToDouble(diff.Value);
|
||||
}
|
||||
|
||||
@@ -595,6 +595,8 @@ public static class BuiltIn
|
||||
public static string KasinoPlanesSize = "Kasino.Planes.Size";
|
||||
[BuiltInSetting("Size (%) of the Plinko board", SettingValueType.Text, "70", WholeNumberRegex)]
|
||||
public static string KasinoPlinkoSize = "Kasino.Plinko.Size";
|
||||
[BuiltInSetting("Whether Cecil is enabled", SettingValueType.Boolean, "true", BooleanRegex)]
|
||||
public static string KasinoCecilEnabled = "Kasino.Cecil.Enabled";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user