mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Extend timeout and prevent creators from raining on themselves
This commit is contained in:
@@ -18,7 +18,7 @@ public class RainCommand : ICommand
|
|||||||
|
|
||||||
public string? HelpText => "!rain <amount> to start a rain, !rain to join all active rains";
|
public string? HelpText => "!rain <amount> to start a rain, !rain to join all active rains";
|
||||||
public UserRight RequiredRight => UserRight.Loser;
|
public UserRight RequiredRight => UserRight.Loser;
|
||||||
public TimeSpan Timeout => TimeSpan.FromSeconds(60);
|
public TimeSpan Timeout => TimeSpan.FromSeconds(90);
|
||||||
public RateLimitOptionsModel? RateLimitOptions => null;
|
public RateLimitOptionsModel? RateLimitOptions => null;
|
||||||
|
|
||||||
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments,
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments,
|
||||||
@@ -56,6 +56,14 @@ public class RainCommand : ICommand
|
|||||||
return;
|
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);
|
await botInstance.BotServices.KasinoRain.AddParticipant(user.Id);
|
||||||
var pluralSuffix = string.Empty;
|
var pluralSuffix = string.Empty;
|
||||||
if (rain.Participants.Count > 0) pluralSuffix = "s";
|
if (rain.Participants.Count > 0) pluralSuffix = "s";
|
||||||
|
|||||||
Reference in New Issue
Block a user