diff --git a/src/NadekoBot/Bot.cs b/src/NadekoBot/Bot.cs index 2fdec9538..968ddea59 100644 --- a/src/NadekoBot/Bot.cs +++ b/src/NadekoBot/Bot.cs @@ -70,6 +70,7 @@ public sealed class Bot : GatewayIntents.AllUnprivileged, LogGatewayIntentWarnings = false, FormatUsersInBidirectionalUnicode = false, + DefaultRetryMode = RetryMode.AlwaysRetry ^ RetryMode.RetryRatelimit }); _commandService = new(new() diff --git a/src/NadekoBot/Db/Models/AntiProtection.cs b/src/NadekoBot/Db/Models/AntiProtection.cs index 625b4d9d5..58df3f108 100644 --- a/src/NadekoBot/Db/Models/AntiProtection.cs +++ b/src/NadekoBot/Db/Models/AntiProtection.cs @@ -48,7 +48,8 @@ public enum PunishmentAction RemoveRoles, ChatMute, VoiceMute, - AddRole + AddRole, + Warn } public class AntiSpamIgnore : DbEntity diff --git a/src/NadekoBot/Modules/Administration/UserPunish/UserPunishCommands.cs b/src/NadekoBot/Modules/Administration/UserPunish/UserPunishCommands.cs index 7e19c56e6..0edd34d17 100644 --- a/src/NadekoBot/Modules/Administration/UserPunish/UserPunishCommands.cs +++ b/src/NadekoBot/Modules/Administration/UserPunish/UserPunishCommands.cs @@ -341,7 +341,8 @@ public partial class Administration public async partial Task WarnPunish(int number, PunishmentAction punish, StoopidTime time = null) { // this should never happen. Addrole has its own method with higher priority - if (punish == PunishmentAction.AddRole) + // also disallow warn punishment for getting warned + if (punish is PunishmentAction.AddRole or PunishmentAction.Warn) return; var success = _service.WarnPunish(ctx.Guild.Id, number, punish, time); diff --git a/src/NadekoBot/Modules/Administration/UserPunish/UserPunishService.cs b/src/NadekoBot/Modules/Administration/UserPunish/UserPunishService.cs index 46353863c..91f6f3044 100644 --- a/src/NadekoBot/Modules/Administration/UserPunish/UserPunishService.cs +++ b/src/NadekoBot/Modules/Administration/UserPunish/UserPunishService.cs @@ -185,6 +185,9 @@ public class UserPunishService : INService, IReadyExecutor guild.Id); } + break; + case PunishmentAction.Warn: + await Warn(guild, user.Id, mod, 1, reason); break; } }