mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Add an option to disable Jackpot
This commit is contained in:
@@ -172,7 +172,13 @@ public class BotServices
|
||||
|
||||
private async Task BuildJackpot()
|
||||
{
|
||||
var proxy = (await SettingsProvider.GetValueAsync(BuiltIn.Keys.Proxy)).Value;
|
||||
var settings = await SettingsProvider.GetMultipleValuesAsync([BuiltIn.Keys.Proxy, BuiltIn.Keys.JackpotEnabled]);
|
||||
if (!settings[BuiltIn.Keys.JackpotEnabled].ToBoolean())
|
||||
{
|
||||
_logger.Debug("Jackpot.bet is disabled");
|
||||
return;
|
||||
}
|
||||
var proxy = settings[BuiltIn.Keys.Proxy].Value;
|
||||
_jackpot = new Jackpot(proxy, _cancellationToken);
|
||||
_jackpot.OnJackpotBet += OnJackpotBet;
|
||||
await _jackpot.StartWsClient();
|
||||
@@ -378,7 +384,7 @@ public class BotServices
|
||||
var settings = await SettingsProvider.GetMultipleValuesAsync([
|
||||
BuiltIn.Keys.KickEnabled, BuiltIn.Keys.HowlggEnabled, BuiltIn.Keys.ChipsggEnabled,
|
||||
BuiltIn.Keys.ClashggEnabled, BuiltIn.Keys.BetBoltEnabled, BuiltIn.Keys.YeetEnabled,
|
||||
BuiltIn.Keys.RainbetEnabled, BuiltIn.Keys.PartiEnabled
|
||||
BuiltIn.Keys.RainbetEnabled, BuiltIn.Keys.PartiEnabled, BuiltIn.Keys.JackpotEnabled
|
||||
]);
|
||||
try
|
||||
{
|
||||
@@ -422,7 +428,7 @@ public class BotServices
|
||||
await BuildHowlgg();
|
||||
}
|
||||
|
||||
if (_jackpot != null && !_jackpot.IsConnected())
|
||||
if (_jackpot != null && settings[BuiltIn.Keys.JackpotEnabled].ToBoolean() && !_jackpot.IsConnected())
|
||||
{
|
||||
_logger.Error("Jackpot died, recreating it");
|
||||
_jackpot.Dispose();
|
||||
|
||||
@@ -200,6 +200,8 @@ public static class BuiltIn
|
||||
[BuiltInSetting("Bossman's usernames on Jackpot", SettingValueType.Array,
|
||||
"[\"TheBossmanJack\", \"Austingambless757\"]")]
|
||||
public static string JackpotBmjUsernames = "Jackpot.BmjUsernames";
|
||||
[BuiltInSetting("Whether Jackpot is enabled", SettingValueType.Boolean, "true", BooleanRegex)]
|
||||
public static string JackpotEnabled = "Jackpot.Enabled";
|
||||
[BuiltInSetting("Bossman's rainbet public IDs", SettingValueType.Array,
|
||||
"[\"Ir04170wLulcjtePCL7P6lmeOlepRaNp\", \"IA9RHFR1NLHL33AVOM9GL2G2CINM9I6P\"]")]
|
||||
public static string RainbetBmjPublicIds = "Rainbet.BmjPublicIds";
|
||||
|
||||
Reference in New Issue
Block a user