nosedrum

a command framework for nostrum

ISC License

Downloads
2.5K
Stars
32
Committers
6

Bot releases are hidden (Show)

nosedrum - 0.6.0 Latest Release

Published by jchristgit over 1 year ago

Version 0.6.0 supports nostrum 0.8.0 and comes with a number of improvements
for working with application commands.

Breaking changes

  • The existing text command handling behaviour has been moved under
    Nosedrum.TextCommand. Application commands have been moved more into the
    spotlight. The following moves have been performed:
    • Nosedrum.Command => Nosedrum.TextCommand
    • Nosedrum.Invoker => Nosedrum.TextCommand.Invoker
    • Nosedrum.Invoker.Split => Nosedrum.TextCommand.Invoker.Split
    • Nosedrum.Storage => Nosedrum.TextCommand.Storage
    • Nosedrum.Storage.ETS => Nosedrum.TextCommand.Storage.ETS
    • Nosedrum.Interactor => Nosedrum.Storage
  • Nosedrum will now return error tuples for converter failures (text-based
    command handling) instead of strings. The main structure that you will likely
    want to check against is {:error, {:not_found, {:by, :id | :name, query, options}}}. See Nosedrum.Converters for details.
  • To prevent a race with deferred interaction responses, their :type field
    must now be returned along with a callback to run after the application
    command handler has sent out the initial deferred interaction response to the
    API.

Changed

  • Application command handling is now performed in the client process calling
    them, not the command interactor.
  • Updated nostrum to 0.8.0.
  • Updated all other dependencies.

Removed

  • Remove member lookup by nickname

Fixed

  • Name of the example application in the Nosedrum.ApplicationCommand
    supervisor example.
nosedrum - 0.5.0

Published by jchristgit over 1 year ago

The library has been updated to work with nostrum 0.7. A
few minor changes have been put in as well. The full changelog can be seen
below.

Added

  • Support multiple prefixes in Nosedrum.Invoker.Split

Changed

  • Updated nostrum to 0.7.0.
  • Updated all other dependencies.

Removed

  • Remove member lookup by nickname

Fixed

  • Name of the example application in the Nosedrum.ApplicationCommand
    supervisor example.
nosedrum - 0.5.0-rc1

Published by jchristgit over 1 year ago

The library has been updated to work with the upcoming nostrum 0.7 release. A
few minor changes have been put in as well. The full changelog can be seen
below.

Added

  • Support multiple prefixes in Nosedrum.Invoker.Split

Changed

  • Updated nostrum to 0.7.0.
  • Updated all other dependencies.

Removed

  • Remove member lookup by nickname

Fixed

  • Name of the example application in the Nosedrum.ApplicationCommand
    supervisor example.
nosedrum - v0.4.0

Published by jchristgit almost 3 years ago

nosedrum version 0.4 comes with support for application commands and
first-class command alias support, as well as bringing in some small
quality improvements to the message cache & documentation.

A huge thanks for this release to Ben W. (@Bentheburrito), who wrote the
application command support and implemented alias support into the
traditional command behaviour & our command storage.

Added

  • Application command support, via the Nosedrum.ApplicationCommand behaviour,
    as well as the Nosedrum.Interactor behaviour & the
    Nosedrum.Interactor.Dispatcher implementation.
  • First-class alias support for traditional commands. If you implemented your
    own Nosedrum.Storage, then you will need to update it to incorporate this
    change. See the diff for
    Nosedrum.Storage.ETS

    as an example of nosedrum implemented it.

Changed

  • Cache entire messages in message cache implementations.
  • Return direct values from :ets.insert or Agent.get_and_update in
    Nosedrum.MessageCache implementations. If you match on the :ok value
    returned in MessageCache.get or MessageCache.update, you will need to
    update your code.
  • Change value to signal "return all cached messages" in
    Nosedrum.MessageCache.recent_in_guild from nil to :infinity.
nosedrum - v0.3.0

Published by jchristgit almost 4 years ago

nosedrum version 0.3 comes with support for nested subcommands. This will require a small update to your add_command invocations to use lists instead of tuples.
Additionally, nosedrum no longer creates its own error messages, but allows the user to deal with creating them. For an example of how to deal with the errors, see bolt's MESSAGE_CREATE handler: https://github.com/jchristgit/bolt/blob/5c19c3d68a419a302a62d4f33b77e5cf87bac659/lib/bolt/consumer/message_create.ex#L14-L22.

Added

  • Support for nested subcommands. Command paths now need to be passed as a list
    instead of a tuple. This may also require an update to custom invokers, see
    changes to Nosedrum.Invoker.Split for details.

Fixed

  • Prevent compiler warning about @short_version module attribute.

Changed

  • Return error tuples instead of creating error messages in the API.
    Specifically, this means that for the following events, manual error checking
    needs to be performed:
    • Unknown subcommands - these return {:error, {:unknown_subcommand, name, :known, known_subcommands}} from the invoker.
    • Predicate permission check failures or error - these return {:error, :predicate, predicate_result} from the invoker.