LemonGateway. CommandRegistry
(lemon_gateway v0.1.0)
View Source
Registry of slash command modules.
Maintains a mapping of command names to their implementing modules.
Commands are invoked when users send /command_name messages through
any transport channel.
Summary
Functions
Returns all registered commands as {name, module} tuples.
Returns a specification to start this module under a supervisor.
Returns the command module for the given name, or nil if not registered.
Returns the command module for the given name, or raises if not found.
Returns a list of all registered command names.
Types
Functions
@spec all_commands() :: [{command_name(), command_mod()}]
Returns all registered commands as {name, module} tuples.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec get_command(command_name()) :: command_mod() | nil
Returns the command module for the given name, or nil if not registered.
@spec get_command!(command_name()) :: command_mod()
Returns the command module for the given name, or raises if not found.
@spec list_commands() :: [command_name()]
Returns a list of all registered command names.