diff --git a/src/NadekoBot/Common/OptionsParser.cs b/src/NadekoBot/Common/OptionsParser.cs index a88ee1524..465e8dc89 100644 --- a/src/NadekoBot/Common/OptionsParser.cs +++ b/src/NadekoBot/Common/OptionsParser.cs @@ -1,15 +1,14 @@ -#nullable disable -using CommandLine; +using CommandLine; namespace NadekoBot.Common; public static class OptionsParser { - public static T ParseFrom(string[] args) + public static T ParseFrom(string[]? args) where T : INadekoCommandOptions, new() => ParseFrom(new T(), args).Item1; - public static (T, bool) ParseFrom(T options, string[] args) + public static (T, bool) ParseFrom(T options, string[]? args) where T : INadekoCommandOptions { using var p = new Parser(x => diff --git a/src/NadekoBot/Modules/Administration/Prune/PruneCommands.cs b/src/NadekoBot/Modules/Administration/Prune/PruneCommands.cs index 85c44dad6..9fa1f4cbb 100644 --- a/src/NadekoBot/Modules/Administration/Prune/PruneCommands.cs +++ b/src/NadekoBot/Modules/Administration/Prune/PruneCommands.cs @@ -72,7 +72,7 @@ public partial class Administration [BotPerm(ChannelPerm.ManageMessages)] [NadekoOptions(typeof(PruneOptions))] [Priority(0)] - public Task Prune(IGuildUser user, int count = 100, string args = null) + public Task Prune(IGuildUser user, int count = 100, params string[] args) => Prune(user.Id, count, args); //prune userid [x]