mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Updated new games so they have individual cleanup delays. Also extended timeouts for Wheel as it's prone to timing out
This commit is contained in:
@@ -30,7 +30,7 @@ public class DiceCommand : ICommand
|
|||||||
public async Task RunCommand(ChatBot botInstance, MessageModel messagen, UserDbModel user, GroupCollection arguments,
|
public async Task RunCommand(ChatBot botInstance, MessageModel messagen, UserDbModel user, GroupCollection arguments,
|
||||||
CancellationToken ctx)
|
CancellationToken ctx)
|
||||||
{
|
{
|
||||||
var cleanupDelay = TimeSpan.FromMilliseconds((await SettingsProvider.GetValueAsync(BuiltIn.Keys.KasinoKenoCleanupDelay)).ToType<int>());
|
var cleanupDelay = TimeSpan.FromMilliseconds((await SettingsProvider.GetValueAsync(BuiltIn.Keys.KasinoDiceCleanupDelay)).ToType<int>());
|
||||||
if (!arguments.TryGetValue("amount", out var amount))
|
if (!arguments.TryGetValue("amount", out var amount))
|
||||||
{
|
{
|
||||||
await botInstance.SendChatMessageAsync(
|
await botInstance.SendChatMessageAsync(
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class LambchopCommand : ICommand
|
|||||||
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments,
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments,
|
||||||
CancellationToken ctx)
|
CancellationToken ctx)
|
||||||
{
|
{
|
||||||
var cleanupDelay = TimeSpan.FromMilliseconds((await SettingsProvider.GetValueAsync(BuiltIn.Keys.KasinoGuessWhatNumberCleanupDelay)).ToType<int>());
|
var cleanupDelay = TimeSpan.FromMilliseconds((await SettingsProvider.GetValueAsync(BuiltIn.Keys.KasinoLambchopCleanupDelay)).ToType<int>());
|
||||||
if (!arguments.TryGetValue("amount", out var amount))
|
if (!arguments.TryGetValue("amount", out var amount))
|
||||||
{
|
{
|
||||||
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, not enough arguments. !lambchop <wager> <number between 1 and {FIELD_LENGTH}>", true, autoDeleteAfter: cleanupDelay);
|
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, not enough arguments. !lambchop <wager> <number between 1 and {FIELD_LENGTH}>", true, autoDeleteAfter: cleanupDelay);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class WheelCommand : ICommand
|
|||||||
public string? HelpText =>
|
public string? HelpText =>
|
||||||
"Its wheel but oval shaped and shit";
|
"Its wheel but oval shaped and shit";
|
||||||
public UserRight RequiredRight => UserRight.Loser;
|
public UserRight RequiredRight => UserRight.Loser;
|
||||||
public TimeSpan Timeout => TimeSpan.FromSeconds(12);
|
public TimeSpan Timeout => TimeSpan.FromSeconds(30);
|
||||||
public RateLimitOptionsModel? RateLimitOptions => new()
|
public RateLimitOptionsModel? RateLimitOptions => new()
|
||||||
{
|
{
|
||||||
MaxInvocations = 3,
|
MaxInvocations = 3,
|
||||||
@@ -64,7 +64,7 @@ public class WheelCommand : ICommand
|
|||||||
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments,
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments,
|
||||||
CancellationToken ctx)
|
CancellationToken ctx)
|
||||||
{
|
{
|
||||||
var cleanupDelay = TimeSpan.FromMilliseconds((await SettingsProvider.GetValueAsync(BuiltIn.Keys.KasinoGuessWhatNumberCleanupDelay)).ToType<int>());
|
var cleanupDelay = TimeSpan.FromMilliseconds((await SettingsProvider.GetValueAsync(BuiltIn.Keys.KasinoWheelCleanupDelay)).ToType<int>());
|
||||||
if (!arguments.TryGetValue("amount", out var amount))
|
if (!arguments.TryGetValue("amount", out var amount))
|
||||||
{
|
{
|
||||||
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, not enough arguments. !wheel <wager> <difficulty: low, medium, high>", true, autoDeleteAfter: cleanupDelay);
|
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, not enough arguments. !wheel <wager> <difficulty: low, medium, high>", true, autoDeleteAfter: cleanupDelay);
|
||||||
|
|||||||
@@ -447,6 +447,12 @@ public static class BuiltIn
|
|||||||
public static string YouTubePubSubRedisChannel = "YouTube.PubSub.RedisChannel";
|
public static string YouTubePubSubRedisChannel = "YouTube.PubSub.RedisChannel";
|
||||||
[BuiltInSetting("Delay in milliseconds before cleaning up limbo", SettingValueType.Text, "15000", WholeNumberRegex)]
|
[BuiltInSetting("Delay in milliseconds before cleaning up limbo", SettingValueType.Text, "15000", WholeNumberRegex)]
|
||||||
public static string KasinoLimboCleanupDelay = "Kasino.Limbo.CleanupDelay";
|
public static string KasinoLimboCleanupDelay = "Kasino.Limbo.CleanupDelay";
|
||||||
|
[BuiltInSetting("Delay in milliseconds before cleaning up lambchop", SettingValueType.Text, "15000", WholeNumberRegex)]
|
||||||
|
public static string KasinoLambchopCleanupDelay = "Kasino.Lambchop.CleanupDelay";
|
||||||
|
[BuiltInSetting("Delay in milliseconds before cleaning up dice", SettingValueType.Text, "15000", WholeNumberRegex)]
|
||||||
|
public static string KasinoDiceCleanupDelay = "Kasino.Dice.CleanupDelay";
|
||||||
|
[BuiltInSetting("Delay in milliseconds before cleaning up wheel", SettingValueType.Text, "30000", WholeNumberRegex)]
|
||||||
|
public static string KasinoWheelCleanupDelay = "Kasino.Wheel.CleanupDelay";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user