mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
Added warn punishment action for protection commands
This commit is contained in:
@@ -70,6 +70,7 @@ public sealed class Bot
|
|||||||
: GatewayIntents.AllUnprivileged,
|
: GatewayIntents.AllUnprivileged,
|
||||||
LogGatewayIntentWarnings = false,
|
LogGatewayIntentWarnings = false,
|
||||||
FormatUsersInBidirectionalUnicode = false,
|
FormatUsersInBidirectionalUnicode = false,
|
||||||
|
DefaultRetryMode = RetryMode.AlwaysRetry ^ RetryMode.RetryRatelimit
|
||||||
});
|
});
|
||||||
|
|
||||||
_commandService = new(new()
|
_commandService = new(new()
|
||||||
|
@@ -48,7 +48,8 @@ public enum PunishmentAction
|
|||||||
RemoveRoles,
|
RemoveRoles,
|
||||||
ChatMute,
|
ChatMute,
|
||||||
VoiceMute,
|
VoiceMute,
|
||||||
AddRole
|
AddRole,
|
||||||
|
Warn
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AntiSpamIgnore : DbEntity
|
public class AntiSpamIgnore : DbEntity
|
||||||
|
@@ -341,7 +341,8 @@ public partial class Administration
|
|||||||
public async partial Task WarnPunish(int number, PunishmentAction punish, StoopidTime time = null)
|
public async partial Task WarnPunish(int number, PunishmentAction punish, StoopidTime time = null)
|
||||||
{
|
{
|
||||||
// this should never happen. Addrole has its own method with higher priority
|
// 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;
|
return;
|
||||||
|
|
||||||
var success = _service.WarnPunish(ctx.Guild.Id, number, punish, time);
|
var success = _service.WarnPunish(ctx.Guild.Id, number, punish, time);
|
||||||
|
@@ -185,6 +185,9 @@ public class UserPunishService : INService, IReadyExecutor
|
|||||||
guild.Id);
|
guild.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case PunishmentAction.Warn:
|
||||||
|
await Warn(guild, user.Id, mod, 1, reason);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user