ChatCommands

class ChatCommands(config: ChatCommands.Config)

Instance of the ChatCommands feature.

Constructors

ChatCommands
Link copied to clipboard
fun ChatCommands(config: ChatCommands.Config)

Types

Companion
Link copied to clipboard
object Companion : EventDispatcherFeature<ChatCommands.Config, ChatCommands>

Adds the functionality to the DiscordClient to easily listen to and parse user commands. Must be configured with command prefix and commands.

Config
Link copied to clipboard
class Config

Functions

registerCommand
Link copied to clipboard
fun registerCommand(command: ChatCommand): Boolean
registerCommands
Link copied to clipboard
fun registerCommands(vararg commands: ChatCommand): Map<ChatCommand, Boolean>

Properties

commandMap
Link copied to clipboard
val commandMap: Map<String, ChatCommand>

Lookup map for the command object for a given alias.

commandPrefixFor
Link copied to clipboard
val commandPrefixFor: suspend (guildId: Snowflake?) -> String

Function that gets the command prefix for the specified guild.

commands
Link copied to clipboard
val commands: Set<ChatCommand>

Commands that have been registered with this feature.

dispatcher
Link copied to clipboard
val dispatcher: CommandDispatcher<ChatCommandSource>

Command dispatcher instance

Sources

jvm source
Link copied to clipboard