mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
dev: Added argumentoutofrange static methods, no functional change
This commit is contained in:
@@ -16,8 +16,7 @@ public partial class Permissions
|
||||
|
||||
private async Task ListBlacklistInternal(string title, BlacklistType type, int page = 0)
|
||||
{
|
||||
if (page < 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(page));
|
||||
ArgumentOutOfRangeException.ThrowIfNegative(page);
|
||||
|
||||
var list = _service.GetBlacklist();
|
||||
var allItems = await list.Where(x => x.Type == type)
|
||||
|
@@ -112,9 +112,8 @@ public sealed class CmdCdService : IExecPreCommand, IReadyExecutor, INService
|
||||
|
||||
public void AddCooldown(ulong guildId, string name, int secs)
|
||||
{
|
||||
if (secs <= 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(secs));
|
||||
|
||||
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(secs);
|
||||
|
||||
var sett = _settings.GetOrAdd(guildId, static _ => new());
|
||||
sett[name] = secs;
|
||||
|
||||
|
Reference in New Issue
Block a user