Method TryGetCommand
- Namespace
- DSharpPlus.Commands.Processors.TextCommands
- Assembly
- DSharpPlus.Commands.dll
TryGetCommand(string, ulong, out int, out Command?)
Attempts to retrieve a command from the provided command text. Searches for the command by name, then by alias. Subcommands are also resolved. This method ignores DefaultGroupCommandAttribute's and will instead return the group command instead of the default subcommand.
public bool TryGetCommand(string commandText, ulong guildId, out int index, out Command? command)
Parameters
commandTextstringThe full command name and optionally it's arguments.
guildIdulongThe guild ID to check if the command is available in the guild. Pass 0 if not applicable.
indexintThe index of
commandTextthat the command name ends at.commandCommandThe resolved command.
Returns
- bool
If the command was found.