Skip to content

Instantly share code, notes, and snippets.

@compil3
Created June 16, 2020 04:30
Show Gist options
  • Save compil3/2963a182bf15ee557538a9ec9cdff082 to your computer and use it in GitHub Desktop.
Save compil3/2963a182bf15ee557538a9ec9cdff082 to your computer and use it in GitHub Desktop.
private static async Task CommandExecutedAsync(Optional<CommandInfo> command, ICommandContext context,
IResult result)
{
if (!command.IsSpecified) return;
if (result.IsSuccess) return;
if (result.ErrorReason == "The input text has too few parameters.")
await context.Channel.SendMessageAsync(
$"***.{command.Value.Name}*** is missing parameters. Use ***.help*** for more information.");
else await context.Channel.SendMessageAsync($"{command.Value.Name}: {result.ErrorReason}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment