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
commandText
stringThe full command name and optionally it's arguments.
guildId
ulongThe guild ID to check if the command is available in the guild. Pass 0 if not applicable.
index
intThe index of
commandText
that the command name ends at.command
CommandThe resolved command.
Returns
- bool
If the command was found.