CommandsFlavor
Extends
ts
ContextProperties
setMyCommands
ts
setMyCommands: (commands: CommandGroup<C> | CommandGroup<C>[], options?: SetBotCommandsOptions) => Promise<void>;Sets the provided commands for the current chat. Cannot be called on updates that don’t have a chat property.
[!IMPORTANT] Calling this method with upperCased command names registered, will throw
getNearestCommand
ts
getNearestCommand: (commands: CommandGroup<C> | CommandGroup<C>[], options?: Omit<Partial<JaroWinklerOptions>, "language">) => string | null;Returns the nearest command to the user input. If no command is found, returns null.
getCommandEntities
ts
getCommandEntities: (commands: CommandGroup<C> | CommandGroup<C>[]) => BotCommandEntity[];commandMatch
ts
commandMatch: CommandMatch;The matched command and the rest of the input.
When matched command is a RegExp, a match property exposes the result of the RegExp match.