v0.5.0
Enter nostrum 0.5: Raw voice, fleshed-out application command support, pluggable
caches, stickers, typed events, scheduled events, did someone say "switch
websocket library again"?
Thanks to @jb3, @Th3-M4jor, @BrandtHill, @bdanklin, @RealVidy, and the many more
people who contributed to the release with pull requests, bug reports, feature
suggestions, or just by being part of the development channel. A full list of
our contributors, minus the mention spam, is at the bottom. Finally, thanks for
the author of this tag for turning what should have been a day project into a
one and a half year long incursion.
Breaking changes
- The following options for
allowed_mentions
have been renamed::user
->:users
{:user, list}
->{:users, list}
{:role, list}
->{:roles, list}
- The
type
value for permission overwrites has changed:"role"
->0
"member"
->1
- Binary map keys coming from Discord that appear to be snowflakes will be
parsed as integers to prevent inconsistencies in e.g. interaction data
payloads - Parse datetimes to datetime objects instead of keeping raw strings
- Require Elixir 1.11
Deprecations
- The
:file
option forNostrum.Api.execute_webhook/3-4
was renamed to
:files
and expects a list of files instead of a single file.:file
will
keep working for the time being, but you are advised to use:files
instead.
Functionality
- Application commands
- Allow adding attachments to an interaction response
- Support for retrieving and editing application command permissions
- Add support for editing and deleting interaction responses
- Add application command bulk overwrite support via
Nostrum.Api.bulk_overwrite_global_application_commands/1-2
and
Nostrum.Api.bulk_overwrite_guild_application_commands/2-3
- Add bangified methods for interaction response functions
- Add structs for building and responding to interactions and working with
message components:Nostrum.Struct.ApplicationCommand
Nostrum.Struct.ApplicationCommandInteractionDataResolved
Nostrum.Struct.Component
Nostrum.Struct.Component.ActionRow
Nostrum.Struct.Component.Button
Nostrum.Struct.Component.Option
Nostrum.Struct.Component.SelectMenu
Nostrum.Struct.Message.Component
- Update the following structs relevant to building and responding to interactions:
Nostrum.Struct.ApplicationCommandInteractionData
Nostrum.Struct.ApplicationCommandInteractionDataOption
Nostrum.Struct.Interaction
Nostrum.Struct.Message
- Miscellaneous
- Allow for sending multiple files in a single message
- Allow retrieval of a guild ban for a single user
- Add sticker support via sticker attributes and
Nostrum.Struct.Message.Sticker
- Add support for specifying an audit log reason in
Nostrum.Api.modify_guild_member/4
- Add webhook message editing support via
Nostrum.Api.edit_webhook_message/4
- Add
Nostrum.Struct.Guild.Member.top_role/2
for retrieving the topmost role
of a member - Add
Nostrum.Struct.Message.to_url/1
for retrieving a message link for a
message - Move to Discord API V8 (both in the REST API and Gateway)
- Channels
- Add types for the following channel types:
- News & store channels
- Threads (public, private, news)
- Stage voice channel
- Add types for the following channel types:
- Documentation updates
- Overhaul of channel documentation (see
Nostrum.Struct.Channel
), which
now gives a great overview for the jungle of Discord's channel types - Document
Nostrum.Struct.Message.type
values - Fix all documentation build warnings
- Move to
ex_doc
version 0.28
- Overhaul of channel documentation (see
- Pluggable caching
- Customize the way nostrum caches objects from Discord
- By default, nostrum will cache objects in ETS tables
- For guilds, we previously used GenServers
- See the "State" documentation page for more details
- Typed events
- The following events will now be returned in special structs:
CHANNEL_PINS_UPDATE
GUILD_BAN_ADD
GUILD_BAN_REMOVE
GUILD_INTEGRATIONS_UPDATE
MESSAGE_REACTION_ADD
MESSAGE_REACTION_REMOVE
MESSAGE_REACTION_REMOVE_ALL
MESSAGE_REACTION_REMOVE_EMOJI
READY
TYPING_START
VOICE_STATE_UPDATE
VOICE_SERVER_UPDATE
- The following events will now be returned in special structs:
- Voice
- Support for streamlink for livestreaming audio
- The new
VOICE_READY
event, fired when the bot is ready for sending audio in
a voice channel - Lots of documentation changes
- Add support for sending raw voice packets ("Bring Your Own Encoder")
- New fine-tuning options for voice playback
- Configure the start position
- Configure the duration to play
- Output volume configuration
- Add support for applying filters to audio
- Realtime switch (ffmpeg-specific) fine-tuning
- New fine-tuning options for voice in general
- Configure the timeout within which the bot must begin generating audio
- Configure how many opus frames to send at a time while playing audio
- Configure whether nostrum should automatically connect to voice websockets
when joining voice channels
- Remake session on errno 4006
- Learn more about the changes on the "Voice" documentation page
- Scheduled events
- Add API methods for CRUD of scheduled events along with getting users subscribed to an
event - Add the following gateway events:
GUILD_SCHEDULED_EVENT_CREATE
GUILD_SCHEDULED_EVENT_UPDATE
GUILD_SCHEDULED_EVENT_DELETE
GUILD_SCHEDULED_EVENT_USER_ADD
GUILD_SCHEDULED_EVENT_USER_REMOVE
- Add the
guild_scheduled_events
intent
- Add API methods for CRUD of scheduled events along with getting users subscribed to an
Usability
- Dialyzer will now catch errors with missing parameters in
Nostrum.Api.execute_webhook/3-4
num_shard: :auto
is now used by default
Internals
- We have switched websocket libraries again!
- Just kidding. We have switched our HTTP client to
:gun
, which we already use
for websocket, which reduced our dependency footprint. - If you see a HTTP multipart request containing
KraigieNostrumCat_
as the
boundary, that's us!
- Just kidding. We have switched our HTTP client to
- Dependency updates,
ex_doc
among others - Fail CI fast if one job fails
Contributors
Thanks to these wonderful folks who have contributed to this release:
- Alex Hincu
- Andris0
- Awlexus
- Bailey Dickens
- Benjamin Danklin
- Brandt Hill
- Craig Dazey
- Joe Banks
- Johannes Christ
- Khionu Sybiern
- Kraigie
- Michael Mitchell
- PixeL
- RealVidy
- The Major
- Vidy
- panoramix360
- wkrp