mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 09:09:00 +03:00
...and a few small touches
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
5239b82806
commit
5ff23722ce
1 changed files with 2 additions and 3 deletions
|
@ -191,7 +191,7 @@ public class WarnCommandGroup : CommandGroup
|
||||||
title, target)
|
title, target)
|
||||||
.WithColour(ColorsList.Green).Build();
|
.WithColour(ColorsList.Green).Build();
|
||||||
|
|
||||||
if (warns.Count >= warnThreshold)
|
if (warns.Count >= warnThreshold && warnThreshold is not 0)
|
||||||
{
|
{
|
||||||
return await PunishUserAsync(target, guild, data, channelId, bot, warns, warnPunishment, warnDuration, CancellationToken);
|
return await PunishUserAsync(target, guild, data, channelId, bot, warns, warnPunishment, warnDuration, CancellationToken);
|
||||||
}
|
}
|
||||||
|
@ -202,8 +202,6 @@ public class WarnCommandGroup : CommandGroup
|
||||||
private async Task<Result> PunishUserAsync(IUser target, IGuild guild, GuildData data,
|
private async Task<Result> PunishUserAsync(IUser target, IGuild guild, GuildData data,
|
||||||
Snowflake channelId, IUser bot, IList warns, string punishment, TimeSpan duration, CancellationToken ct)
|
Snowflake channelId, IUser bot, IList warns, string punishment, TimeSpan duration, CancellationToken ct)
|
||||||
{
|
{
|
||||||
warns.Clear();
|
|
||||||
|
|
||||||
if (punishment is "ban" && duration != TimeSpan.Zero)
|
if (punishment is "ban" && duration != TimeSpan.Zero)
|
||||||
{
|
{
|
||||||
var banCommandGroup = new BanCommandGroup(
|
var banCommandGroup = new BanCommandGroup(
|
||||||
|
@ -228,6 +226,7 @@ public class WarnCommandGroup : CommandGroup
|
||||||
duration, guild.ID, data, channelId, bot, ct);
|
duration, guild.ID, data, channelId, bot, ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
warns.Clear();
|
||||||
return Result.FromSuccess();
|
return Result.FromSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue