nosedrum
is a command framework for use with the excellent
nostrum
library.
It contains behaviour specifications for easily implementing command handling for both Discord's application commands and the traditional text-based commands in your bot along with other conveniences to ease creating an interactive bot.
nosedrum
s provided implementations are largely based off what was originally
written for bolt. bolt also contains
around 57
commands based
off the Nosedrum.TextCommand
behaviour that you can explore if you're looking
for inspiration.
The application command related parts of the framework consist of two parts:
Nosedrum.ApplicationCommand
, the behaviour that all application commandsNosedrum.Storage
, the behaviour for any slash command storage. A defaultNosedrum.Storage.Dispatcher
.The traditional command processing related parts of the framework consists of three parts:
Nosedrum.TextCommand
, the behaviour that all commands must implement.Nosedrum.TextCommand.Invoker
, the behaviour of command processors. Command processorsNosedrum.TextCommand.Invoker.Split
.Nosedrum.TextCommand.Storage
, the behaviour of command storages. Command storagesNosedrum.TextCommand
Nosedrum.TextCommand.Storage.ETS
.Additionally, the following utilities are provided:
Nosedrum.Converters
, functions for converting parts of messages to objectsNosedrum.MessageCache
, a behaviour for defining message caches, along withThe documentation can be found at https://hexdocs.pm/nosedrum.
Simply add :nosedrum
to your mix.exs
:
def deps do
[
{:nosedrum, "~> 0.5"},
]
end
If you want to install the GitHub version of Nostrum, you will need to specify
it with override: true
in your mix.exs
, for example:
def deps do
[
{:nosedrum, "~> 0.5"},
{:nostrum, github: "Kraigie/nostrum", override: true}
]
end