Lots of changes in this release! Too many, actually. I apologize for letting this drag out for so long. Checkout the commit history and the milestone tracker. Read all the below breaking changes and join the Discord chat channel to ask any questions! I've tried to document all the major changes here but it's possible I missed something!
For future reference! DiscordGo now has 109 stars, 28 forks, and 10 contributors! The project keeps growing at a nice steady pace and I'm excited that it's been useful for so many people!
Special Thanks To
- https://github.com/iopred
- https://github.com/jonas747
- https://github.com/VagantemNumen
- https://github.com/IMcPwn
- https://github.com/Harmon758
- https://github.com/b1naryth1ef
- https://github.com/nstafie
for all the help and contributions to the project! You are all very very appreciated.
Notice / Breaking Changes
- Creating a new session in any manor other than discordgo.New() is no longer officially supported. So if you do that and stuff breaks it's on you :) d69fac5
- Dropped support for Go 1.3 #177
- Dropped support for Go 1.4, DiscordGo will maintain for the latest 3 main versions of Go.
- Session.UserChannelPermissions is now deprecated. Please use State.UserChannelPermissions
- When connecting to voice, if you set your bot as deaf then a udp listener will not be started on the voice connection. 4cac19c
- Huge number of updates to improve voice connection and reconnects. This is still an unfinished area but it should now be much more stable than before.
- Renamed RateLimit struct to TooManyRequests{} and added new event struct RateLimit{} which can be registerd to with AddHandler() and will be emitted anytime a HTTP 429 is received on the HTTP API. 098d786 38c51ce
- No longer calling onEvent as goroutine, This is a stability improvement but may have a slight performance impact. This change will be reviewed again later. Doing this solves a data race issue with the Sequence number that must be tracked for gateway resume and heartbeats. Event specific handlers are now called
as a goroutine though. - VoiceReady and UDPReady are deprecated. DataReady is.. semi-deprecated :) af57bc1
- Session.UserChannelPermissions is deprecated. Please use State.UserChannelPermissions -- Also, UserChannelPermissions now pulls from State instead of calling REST API endpoints. b225864 TODO!! TODO!!
Enhancements
- Sharding Support #166
- Support for GuildEmbed and GuildIntegration endpoints #170
- Added support for message pinning #223
- Switch to Gateway V4 #167
- Improvements to State #169 #168 #184 #193
- Guild Integrations & Guild Embed support added #170
- Support for additional fields added to Ready packet #174
- Settings struct improvements #176
- DefaultMessageNotifications added to Guild struct #179
- Added example of a Airhorn style bot. #181
- Support for Nicknames #187 #189
- MentionRoles added to Message struct #188
- Added support for streaming status updates #194
- State now tracks roles #196
- Added ability to disable/enable specific parts of State tracking #196
- Added support for bulk delete #199
- Added examples for setting bot avatar #201
- Added Guild Positions to Settings struct #203
- Added GuildChannelsReorder func #211
- Change ALL_CAPS endpoints to more Go idiomatic naming. #212
- Add Sharding support #215
- Added UserGuildSettingsEdit func #216
- Add ChannelMessage function to get a single message by ID #217
- UserChannelPermissions now pulls information from State.
- Added several new examples! Check them out.
- Few more unit tests added.
- Added a new logging system that provides a lot more useful detail. Log levels can be configured allowing you to customize how much detail is logged. See logging.go. Also logs now all prints to stderr instead of stdout.
- Better rate limit handling using per URL mutex locks. ad2aa61
- We now send a heartbeat in response to gateway Op 1 message 53a826d
- Resume to gateway connections when possible. 9bc6057 c65d509 a9da8a5
- Do not write concurrently to websocket connections e9e9ef8 cb9e306
- Added MFAEnabled to User struct eeb2d4f
- Semi-Properly close websocket connections bbce261