Fixed .prune @Target not working bug

This commit is contained in:
Kwoth
2022-10-25 02:07:05 +02:00
parent 9d9e61fdfb
commit f5f0f1e250
2 changed files with 4 additions and 5 deletions

View File

@@ -1,15 +1,14 @@
#nullable disable using CommandLine;
using CommandLine;
namespace NadekoBot.Common; namespace NadekoBot.Common;
public static class OptionsParser public static class OptionsParser
{ {
public static T ParseFrom<T>(string[] args) public static T ParseFrom<T>(string[]? args)
where T : INadekoCommandOptions, new() where T : INadekoCommandOptions, new()
=> ParseFrom(new T(), args).Item1; => ParseFrom(new T(), args).Item1;
public static (T, bool) ParseFrom<T>(T options, string[] args) public static (T, bool) ParseFrom<T>(T options, string[]? args)
where T : INadekoCommandOptions where T : INadekoCommandOptions
{ {
using var p = new Parser(x => using var p = new Parser(x =>

View File

@@ -72,7 +72,7 @@ public partial class Administration
[BotPerm(ChannelPerm.ManageMessages)] [BotPerm(ChannelPerm.ManageMessages)]
[NadekoOptions(typeof(PruneOptions))] [NadekoOptions(typeof(PruneOptions))]
[Priority(0)] [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(user.Id, count, args);
//prune userid [x] //prune userid [x]