DiscordInteractions.CommandRegistration (discord_interactions v0.1.0)
View SourceThis module is responsible for registering both global and guild-specific commands with Discord.
Usage
Add the CommandRegistration task to your application's supervision tree:
def start(_type, _args) do
children = [
# Other children...
YourAppWeb.Endpoint,
{DiscordInteractions.CommandRegistration, YourApp.Discord}
]
opts = [strategy: :one_for_one, name: YourApp.Supervisor]
Supervisor.start_link(children, opts)
endThe task will automatically register all commands defined in your handler module when your application starts.
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
arg is passed as the argument to Task.start_link/1 in the :start field
of the spec.
For more information, see the Supervisor module,
the Supervisor.child_spec/2 function and the Supervisor.child_spec/0 type.