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_mentionshave been renamed::user->:users{:user, list}->{:users, list}{:role, list}->{:roles, list}
- The
typevalue 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
:fileoption forNostrum.Api.execute_webhook/3-4was renamed to
:filesand expects a list of files instead of a single file.:filewill
keep working for the time being, but you are advised to use:filesinstead.
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-2and
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.ApplicationCommandNostrum.Struct.ApplicationCommandInteractionDataResolvedNostrum.Struct.ComponentNostrum.Struct.Component.ActionRowNostrum.Struct.Component.ButtonNostrum.Struct.Component.OptionNostrum.Struct.Component.SelectMenuNostrum.Struct.Message.Component
- Update the following structs relevant to building and responding to interactions:
Nostrum.Struct.ApplicationCommandInteractionDataNostrum.Struct.ApplicationCommandInteractionDataOptionNostrum.Struct.InteractionNostrum.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/2for retrieving the topmost role
of a member - Add
Nostrum.Struct.Message.to_url/1for 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.typevalues - Fix all documentation build warnings
- Move to
ex_docversion 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_UPDATEGUILD_BAN_ADDGUILD_BAN_REMOVEGUILD_INTEGRATIONS_UPDATEMESSAGE_REACTION_ADDMESSAGE_REACTION_REMOVEMESSAGE_REACTION_REMOVE_ALLMESSAGE_REACTION_REMOVE_EMOJIREADYTYPING_STARTVOICE_STATE_UPDATEVOICE_SERVER_UPDATE
- The following events will now be returned in special structs:
- Voice
- Support for streamlink for livestreaming audio
- The new
VOICE_READYevent, 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_CREATEGUILD_SCHEDULED_EVENT_UPDATEGUILD_SCHEDULED_EVENT_DELETEGUILD_SCHEDULED_EVENT_USER_ADDGUILD_SCHEDULED_EVENT_USER_REMOVE
- Add the
guild_scheduled_eventsintent
- 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: :autois 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_docamong 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