File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public class GlobalCmds
1111 [ Command ( "helptextcmd" ) , Description ( "Displays command help." ) ]
1212 [ TextAlias ( "help" ) ]
1313 [ AllowedProcessors ( typeof ( TextCommandProcessor ) ) ]
14- public async Task Help ( CommandContext ctx , [ Description ( "Command to provide help for." ) , RemainingText ] string command = "" )
14+ public static async Task Help ( CommandContext ctx , [ Description ( "Command to provide help for." ) , RemainingText ] string command = "" )
1515 {
1616 var commandSplit = command . Split ( ' ' ) ;
1717
@@ -319,7 +319,7 @@ public class Reminder
319319 // Runs command context checks manually. Returns a list of failed checks.
320320 // Unfortunately DSharpPlus.Commands does not provide a way to execute a command's context checks manually,
321321 // so this will have to do. This may not include all checks, but it includes everything I could think of. -Milkshake
322- private async Task < IEnumerable < ContextCheckAttribute > > CheckPermissionsAsync ( CommandContext ctx , Command cmd )
322+ private static async Task < IEnumerable < ContextCheckAttribute > > CheckPermissionsAsync ( CommandContext ctx , Command cmd )
323323 {
324324 var contextChecks = cmd . Attributes . Where ( x => x is ContextCheckAttribute ) ;
325325 var failedChecks = new List < ContextCheckAttribute > ( ) ;
Original file line number Diff line number Diff line change 1- using static Cliptok . Program ;
1+ using DSharpPlus . Commands . Converters . Results ;
2+ using static Cliptok . Program ;
23
34namespace Cliptok . Events
45{
@@ -32,6 +33,12 @@ public static async Task TextCommandErrored(CommandErroredEventArgs e)
3233
3334 if ( e . Exception is CommandNotFoundException && ( e . Context . Command is null || commandName != "help" ) )
3435 return ;
36+
37+ if ( e . Exception is ArgumentParseException && e . Context . Arguments . All ( x => x . Value is null or ArgumentNotParsedResult or Optional < ArgumentNotParsedResult > ) )
38+ {
39+ await Commands . GlobalCmds . Help ( e . Context , e . Context . Command . Name ) ;
40+ return ;
41+ }
3542
3643 // avoid conflicts with modmail
3744 if ( commandName == "edit" || commandName . Contains ( "timestamp" ) )
You can’t perform that action at this time.
0 commit comments