getApplicationCommandById

abstract fun <T : ApplicationCommandInfo> getApplicationCommandById(type: Class<T>, commandId: Long, group: String?, subcommand: String?): T?(source)

Returns the application command with the specific type, id, group and subcommand, or null if one of the expected arguments does not match.

Works for both global and guild commands.

Parameters

type

Expected type of the application command

commandId

Expected ID of the top-level command

group

Optional group name

subcommand

Optional subcommand name