I didn't think there could possibly be a release larger than 2.0.0 was, but here it is! Including the respective release commit, there were 540 commits from 1.8.1 to 2.0.0, but a whopping 734 commits from 2.1.3 to 3.0.0.
As with 2.0.0, there are some breaking changes! They are, as always, highlighted in bold.
- **The `application_id` parameter has been renamed to `client_id`**. With the changes to how bot applications work, it would just be confusing to have it be called `application_id` any longer. If you try to use `application_id` now, it will raise a descriptive exception; with 3.1.0 that will be removed too (you'll get a less descriptive exception).
- The gateway implementation has been completely rewritten, for more performance, stability and maintainability. This means that **to call some internal methods like `inject_reconnect`, a `Gateway` instance (available as `Botgateway`) now needs to be used.**
- **User login using email and password has been removed**. Use a user token instead, see also [here](https://github.com/hammerandchisel/discord-api-docs/issues/69issuecomment-223886862).
- In addition to the rewrite, the gateway version has also been upgraded to protocol version 6 (the rewrite was for v5). **With this, the way channel types are handled has been changed a bit!** If you've been using the abstraction methods like `Channelvoice?`, you should be fine though. This also includes support for group chats on user accounts, as that was the only real functionality change on v6. ([211](https://github.com/meew0/discordrb/pull/211), thanks Daniel-Worrall)
- **Custom prefix handlers for `CommandBot`s now get the full message object as their parameter rather than only the content**, for even more flexibility.
- For internal consistency, **the `UnknownGuild` error was renamed to `UnknownServer`**. I doubt this change affects anyone, but if you handle that error specifically in your bot, make sure to change it.
- **The API module has undergone a refactor**, if you were using any manual API calls you will have to update them to the new format. Specifically, endpoints dealing with channels have been moved to `API::Channel`, ones dealing with users to `API::User` and so on. ([203](https://github.com/meew0/discordrb/pull/203), thanks depl0y)
- **Calling `users` on a text channel will now only return users who have permission to read it** ([186](https://github.com/meew0/discordrb/issues/186))
- A variety of new fields have been added to `Message` objects, specifically embeds (`Messageembeds`), when it was last edited (`edited_timestamp`), whether it uses TTS (`tts?`), its nonce (`nonce`), whether it was ever edited (`edited?`), and whether it mentions everyone (`mention_everyone?`) ([206](https://github.com/meew0/discordrb/pull/206), thanks SnazzyPine25)
- A variety of new functionality has been added to `Server` and `Channel` objects ([181](https://github.com/meew0/discordrb/pull/181), thanks SnazzyPine25):
- Bitrate and user limit can now be read and set for voice channels
- Server integrations can now be read
- Server features and verification level can now be read
- Utility functions to generate widget, widget banner and splash URLs
- Message pinning is now supported, both reading pin status and pinning existing messages ([145](https://github.com/meew0/discordrb/issues/145) / [146](https://github.com/meew0/discordrb/pull/146), thanks hlaaftana)
- Support for the new available statuses:
- `Botdnd` to make the bot show up as DnD (red dot)
- `Botinvisible` to make the bot show up as offline
- Setting the bot's status to streaming is now supported ([128](https://github.com/meew0/discordrb/pull/128) and [143](https://github.com/meew0/discordrb/pull/143), thanks SnazzyPine25 and barkerja)
- You can now set a message to be sent when a `CommandBot`'s command fails with a `NoPermission` error ([200](https://github.com/meew0/discordrb/pull/200), thanks PoVa)
- There is now an optional field to list the parameters a command can accept ([201](https://github.com/meew0/discordrb/pull/201), thanks FormalHellhound)
- Commands can now have an array of roles set that are required to be able to use it ([178](https://github.com/meew0/discordrb/pull/178), thanks PoVa)
- Methods like `CommandEvent<<` for quickly responding to an event are now available in `MessageEvent` too ([154](https://github.com/meew0/discordrb/pull/154), thanks hlaaftana)
- Temporary messages, that automatically delete after some time, can now be sent to channels ([136](https://github.com/meew0/discordrb/issues/136) / [139](https://github.com/meew0/discordrb/pull/139), thanks unleashy)
- Captions can now be sent together with files, and files can be attached to events to be sent on completion ([130](https://github.com/meew0/discordrb/pull/130), thanks SnazzyPine25)
- There is now a `Channelload_message` method to get a single message by its ID ([174](https://github.com/meew0/discordrb/pull/174), thanks z64)
- `Channeldefine_overwrite` can now be used with a `Profile` object, together with some internal changes ([232](https://github.com/meew0/discordrb/issues/232))
- There are now endpoint methods to list a server's channels and channel invites ([197](https://github.com/meew0/discordrb/pull/197))
- Two methods, `Memberroles=` and `Membermodify_roles` to manipulate a member's roles in a more advanced way have been added ([223](https://github.com/meew0/discordrb/pull/223), thanks z64)
- Role mentionability can now be set using `Rolementionable=`
- The current bot's OAuth application can now be read ([175](https://github.com/meew0/discordrb/pull/175), thanks SnazzyPine25)
- You can now mute and deafen other members ([157](https://github.com/meew0/discordrb/pull/157), thanks SnazzyPine25)
- The internal `Logger` now supports writing to a file instead of STDOUT ([171](https://github.com/meew0/discordrb/issues/171))
- Building on top of that, you can also write to multiple streams at the same time now, in case you want to have input on both a file and STDOUT, or even more advanced setups. ([217](https://github.com/meew0/discordrb/pull/217), thanks PoVa)
- Roles can now have their permissions bitfield set directly ([177](https://github.com/meew0/discordrb/issues/177))
- The `Botinvite_url` method now supports adding permission bits into the generated URL ([218](https://github.com/meew0/discordrb/pull/218), thanks PoVa)
- A utility method `Usersend_file` has been added to directly send a file to a user in PM ([168](https://github.com/meew0/discordrb/issues/168) / [172](https://github.com/meew0/discordrb/pull/172), thanks SnazzyPine25)
- You can now get the list of members that have a particular role assigned using `Rolemembers` ([147](https://github.com/meew0/discordrb/pull/147), thanks hlaaftana)
- You can now check whether a `VoiceBot` is playing right now using `playing?` ([137](https://github.com/meew0/discordrb/pull/137), thanks SnazzyPine25)
- You can now get the channel a `VoiceBot` is playing on ([138](https://github.com/meew0/discordrb/pull/138), thanks snapcase)
- The permissions bit map has been updated for emoji, "Administrator" and nickname changes ([180](https://github.com/meew0/discordrb/pull/180), thanks megumisonoda)
- A method `Botconnected?` has been added to check whether the bot is currently connected to the gateway.
- The indescriptive error message that was previously sent when calling methods like `Botgame=` without an active gateway connection has been replaced with a more descriptive one.
- The bot's token is now, by default, redacted from any logging output; this can be turned off if desired using the `redact_token` initialization parameter. ([225](https://github.com/meew0/discordrb/issues/225) / [231](https://github.com/meew0/discordrb/pull/231), thanks Daniel-Worrall)
- The new rate limit headers are now supported. This will have no real impact on any code using discordrb, but it means discordrb is now considered compliant again. See also [here](https://github.com/hammerandchisel/discord-api-docs/issues/108).
- Rogue presences, i.e. presences without an associated cached member, now print a log message instead of being completely ignored
- A variety of aliases have been added to existing methods.
- An example to show off voice sending has been added to the repo, and existing examples have been improved.
- A large amount of fixes and clarifications have been made to the docs.
Bugfixes
- The almost a year old bug where changing the own user's username would reset its avatar has finally been fixed.
- The issue where resolving a large server with the owner offline would sometimes cause a stack overflow has been fixed ([169](https://github.com/meew0/discordrb/issues/169) / [170](https://github.com/meew0/discordrb/issues/170) / [191](https://github.com/meew0/discordrb/pull/191), thanks stoodfarback)
- Fixed an issue where if a server had an AFK channel set, but that AFK channel couldn't be connected to, resolving the server (and in turn all objects depending on it) would fail. This likely fixes any random `NoPermission` errors you've ever encountered in your log.
- A message's author will be resolved over the REST API like other objects in case it's not cached yet. This should fix all instances of "Member not cached even thought it should be". ([210](https://github.com/meew0/discordrb/pull/210), thanks megumisonoda)
- Voice state handling has been completely redone, fixing a variety of caching issues. ([159](https://github.com/meew0/discordrb/issues/159))
- Getting a voice channel's users no longer does a chunk request ([142](https://github.com/meew0/discordrb/issues/142))
- `Channeldefine_overwrite` can now be used to define user overwrites, apparently that didn't work at all before
- Nested command chains where an inner command doesn't exist now no longer crash the command chain handler ([215](https://github.com/meew0/discordrb/issues/215))
- Gateway errors should no longer spam the console ([141](https://github.com/meew0/discordrb/issues/141) / [148](https://github.com/meew0/discordrb/pull/148), thanks meew0)
- Role hoisting (both setting and reading it) should now work properly
- The `VoiceBotstop_playing` method should now work more predictably
- Voice states with a nil channel should no longer crash when accessed ([183](https://github.com/meew0/discordrb/pull/183), thanks Apexal)
- A latent bug in how PM channels were cached is fixed, previously they were cached twice - once by channel ID and once by recipient ID. Now they're only cached by recipient ID.
- Two problems in how Discord outages are handled are now fixed; the bot should now no longer break when one happens. Specifically, the fixed problems are:
- `GUILD_DELETE` events for unavailable servers are now ignored
- Opcode 9 packets which are received while no session currently exists are handled correctly
- A possible regression in PM channel creation was fixed. ([227](https://github.com/meew0/discordrb/issues/227) / [228](https://github.com/meew0/discordrb/pull/228), thanks heimidal)