Extend timeout and prevent creators from raining on themselves

This commit is contained in:
barelyprofessional
2026-01-28 00:47:26 -06:00
parent 96f17c14cf
commit 305082e17f

View File

@@ -18,7 +18,7 @@ public class RainCommand : ICommand
public string? HelpText => "!rain <amount> to start a rain, !rain to join all active rains";
public UserRight RequiredRight => UserRight.Loser;
public TimeSpan Timeout => TimeSpan.FromSeconds(60);
public TimeSpan Timeout => TimeSpan.FromSeconds(90);
public RateLimitOptionsModel? RateLimitOptions => null;
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments,
@@ -56,6 +56,14 @@ public class RainCommand : ICommand
return;
}
if (rain.Creator == user.Id)
{
await botInstance.SendChatMessageAsync(
$"{user.FormatUsername()}, you can't participate in your own rain!", true,
autoDeleteAfter: cleanupDelay);
return;
}
await botInstance.BotServices.KasinoRain.AddParticipant(user.Id);
var pluralSuffix = string.Empty;
if (rain.Participants.Count > 0) pluralSuffix = "s";