Skip to content

Releases: bwmarrin/discordgo

DiscordGo v0.18.0

27 Dec 21:28
Compare
Choose a tag to compare

Special Thanks To

for all the help and contributions to this project - leading to this release! You are all very appreciated!

Enhancements

  • Session.Open() now validates the connection is successful and reports errors when it is not. (#198)
  • Added rate limit buffering support (#430)
  • Added GameType (#435)
  • Added ParentID to Channel struct (#448, #447)
  • Switch to new Bulk Delete endpoint (#320, #451)
  • Members from GuildMembersChunk are now added to state (#456)
  • Implemented raw sending of status (Rich Presence and Online Status) (#462)
  • Add support for custom logging behavior. (#465)
  • Allow size parameter to be omitted in User.AvatarURL (#468)
  • Added the unique field to the invite struct (#487)
  • Added ChannelEditComplex (#493)
  • Added support for animated emojis (#496)

Fixes

  • Remove a misspelled copy of EndpointGuildInvites. (#440, #441)
  • Fixed Channel struct's JSON tag for Recipients (#444, #443)
  • Fixed GuildCreate using incompatible endpoint (#437, #452)
  • Use v.log rather than log for consistency (#464)
  • Fix typos :) (#466, #482, #486)
  • Remove XKCDPass Invites (#477, #477)
  • Fixed TimeStamps unmarshalling (#474, #470)
  • Properly return on errors in GuildRoleEdit and GuildPruneCount (b58212a)

DiscordGo v0.17.0

05 Sep 20:51
Compare
Choose a tag to compare

Special Thanks To

for all the help and contributions to the project! You are all very very appreciated.

Enhancements

  • ContentWithMentionReplaced on roles and nicks (#375)
  • Added function AvatarURL(size string) string that returns a URL to the user's avatar (#388)
  • Add and fix support for multiple file uploads via ChannelMessageSendComplex via the new field MessageSend.Files (#391)
  • Add heartbeat ACK response and error handling (Op11, Op7) (#396)
  • Hardcoded reactions ratelimit because Discord gives incorrect value in headers. (#398)
  • Add function GuildMemberDeleteWithReason(guildID, userID, reason string) (#399)
  • remove runtime.LockOSThread call from opusSender (#404)
  • gracefully handle the possibility of a race condition attempting to reconnect twice (#407)
  • Updated to gateway v6 (#410)
  • Add memberMap to State to speed up member queries (#411)
  • Added function MessageReactionsRemoveAll(channelID, messageID string) that deletes all reactions from a message (#414)
  • Add option for calling event handlers sync or async (#416)
  • Export State.OnInterface (#417)
  • Add error code constants (#418)
  • Add NSFW channel field (#419)

Bug Fixes

  • Email/Password are omitted if empty on UserUpdate (#383)
  • Fix goroutine leak in opusReceiver (#393)
  • Fix presence update after breaking API change (#427)
  • Fix receiving voice after client sets extended header bit (#428)
  • Fix an issue causing WebhookDelete to always return an error (#429, #432)
  • Fix an issue with session GuildCreate using incompatible endpoint (#437, #439, fd8721a,

DiscordGo v0.16.0

15 May 14:50
Compare
Choose a tag to compare

Alright, DiscordGo v0.16.0 :)

For future reference, DiscordGo now has 289 stars, 78 forks, and 35 contributors!

Special Thanks To

for all the help and contributions to the project! You are all very very appreciated.

Notice / Breaking Changes

  • ChannelMessages method now has an around parameter #306
  • UserGuilds method now has limit, beforeID, and afterID parameters #296
  • UserAvatar method is deprecated. Please use UserAvatarDecode #337

Enhancements

  • Added ChannelMessageEditComplex function #349
  • Added ChannelMessageSendComplex function #349
  • Added GuildBanCreateWithReason method #367
  • We now report an error when trying to login with an account that has 2FA #359
  • We're now using Gateway V5... Better than v4 :) #220
  • Added support for getting the color of a user #299
  • Added some missing Permission constants #302 #378
  • Added support for MessageDeleteBulk event #304
  • Avatars, Icons, Splashes, etc images are now have CDN endpoints and have been updated to request .png files. #309
  • Track voice-channel movements in onVoiceStateUpdate() #317
  • Add support for @me in GuildMemberNickname #319
  • Added method ChannelMessageSendEmbedWithMessage #335
  • Added method UserAvatarDecode to fetch the Avatar of a user. #337
  • Added convenience function Tag() method to user struct to return a formatted mention for that user #364
  • Added convenience function String() method to User struct. #350
  • Added convenience function SetContent to MessageParams struct #352
  • Added support for MessageReactionRemoveAll event #357 691040e
  • Add Presence Tracking to State #371
  • Make returned errors constants #377

Bug Fixes

  • Some cleanup: #368 #338 #339 #344 #347
  • Fixed permissions to take into account @everyone override in channels. #298
  • Fixed several possible race conditions #303 #307 #340
  • Use proper ratelimit buckets for RoleAdd and RoleRemove #311
  • Fixed leaking tickers #314
  • Fix presence unmarshal with game names as numbers #381

v0.15.0

10 Dec 15:17
Compare
Choose a tag to compare

This is my first release and a long time coming. The major updates for v0.15.0 are rate limits, the removal of reflection from the library and a bunch of new features!

Huge thanks to @jonas747 for the rate limiting code!

Special Thanks To

for all the help and contributions to the project! Your support is what makes DiscordGo possible!

Large changes

  • Remove use of reflect, this is a long standing idiom problem with the library. DiscordGo now uses go generate to generate event handlers. 3660125 #285
  • Rate limiting! Per route and global. #273
  • Support for message embeds. 717c8f2 #290
  • Support for new member role endpoint. #289
  • Support for reactions. #275 #283
  • Support for webhooks. #274
  • Support for relationships. #284
  • Support for user status. #258

DiscordGo v0.13.0

18 Jul 22:15
Compare
Choose a tag to compare

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

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

Bug Fixes

  • Fix Invite unmarshal error #171
  • Fix ChannelMessageAck encoding type error #186
  • Fixed project name in LICENSE file #202
  • Correctly set Channel ID when changing voice channels #207
  • Several possible data race events have been fixed.

v0.12.1

13 Apr 17:51
Compare
Choose a tag to compare

Quick bug fix release.

Fix channelMap not being filled for bot users/>100 guilds #165

v0.12.0 Release

12 Apr 17:33
Compare
Choose a tag to compare

Notices

Checkout the commit history and the milestone tracker for full change history.

Breaking Changes

  • Raw OnEvent event now always fires and includes both the raw json data and any unmarshalled struct, if available, this can be used for many things including better logging or debugging. #156 974ed74 836e78d
  • VoiceChannelJoin now blocks until a connection is open or fails. The function now returns an error value that must be checked. You no longer need to have additional code to wait for the voice connection. 7ec5304
  • UDPConn variable on Voice connections is no longer exported 3ffbbdc
  • OP2 variable on Voice connections is no longer exported cab4964

Enhancements

  • Support user guild settings update event #130
  • Ready events now also fire even after a unmarshalling error #131
  • Added support for setting guild region and verification level #132 #136
  • Voice now uses encryption instead of plain communication #133
  • Discordgo logo is now transparent! #134
  • UserChannelPermissions function added that provides the user permissions for a specific channel #140
  • Added multi-guild voice support #141
  • Changed all fmt.Print logging to log.Print #155
    #156
  • State performance fixes and other improvements #157 #158 #159 #160
  • Support for Guild lazy loading #161
  • Added Oauth2 functions for creating user applications and bot accounts. See oauth2.go
  • Added Event for Voice Speaking Updates 584b06a
  • Added initial support for PresenseReplace events 6e56853

Bugs

  • Fixed a bug in voice connections where it would attempt to open a connection before all information was received. 7bbcfe7

v0.11.0 Release

21 Feb 02:57
Compare
Choose a tag to compare

Notices

Lots of changes in this release! Checkout the commit history and the milestone tracker. Read all the below breaking changes and join the Discord chat channel to ask any questions!

Breaking Changes

  • Renamed Opus channel to OpusSend b4b144e
  • Huge breaking change to how user callback for events are handled. Please see commit notes here #109 28236b4
  • ChannelMessages() func now takes beforeID and afterID as strings. #127 #120
  • Removed func GuildInviteCreate() which attempts to use a non-existent endpoint. This probably won't effect many people :) #100

Enhancements

  • With AddHandler() function you can now register any number of callback functions to any event. The function also returns a func that if called will remove the added function. See #109 iopred@7924727
  • Lots of improvements to Voice functionality, changing channels and voice guilds now works. Library voice API is much more stable now and less likely to change. #123 #112 #115
  • Added func ChannelVoiceLeave() which can be used to disconnect from voice entirely. #118
  • Added Bitrate field to Channel struct which will show the configured bitrate for voice channels. #116
  • Added new Guild Member funcs GuildMembers() and GuildMember() #114 #106 #105
  • Added GuildLeave() func to support the new method of leaving a guild (vs deleting) 0dea869 #110
  • Added func GuildMemberMove() that can be used to move a guild member from once voice channel to another (or to no channel) #92 22bb771
  • Added OpusRecv channel to Session.Voice. This can be used to receive opus audio data from Discord. b4b144e 68308c6 #54 See the dgvoice package for examples on how to make use of this.
  • Added support for sending TTS messages with ChannelMessageSendTTS func 363a28a #108
  • Added support for uploading files to channel with ChannelFileSend func bf3f2c5 #104
  • Added user callback support for the VoiceServerUpdate event 9d0be66347a07faf56439de89695a7853319ae6 #103

Bug Fixes

  • General cleanup/linting, several typo's, spelling fixes, comments added, dead code removed, etc.
  • VOICE_STATE_UPDATE event now calls the proper callback function #101

v0.10.0 Release.

27 Jan 19:31
Compare
Choose a tag to compare

Notice

  • Session.Voice.UDPConn and Session.Voice.OP2 may be unexported in the v0.11.0 release.

Enhancements

  • If Session.ShouldReconnectOnError is set to true (defaults to true when using New()) the library will now try to reconnect to Discord all on it's own when it disconnects due to an error. This will slowly back off attempts on each try until it hits 10 minutes then it will try every 10 minutes. 54e14ba
  • Added support for compressed websocket data. This is enabled by default when using the New() func. You can disable/enable it by setting the Session.Compress bool to true/false. fd32614
  • Added new function, GuildMemberEdit that can be used to edit the roles of a Guild Member. 46f893c
  • Session.Voice.Opus channel added. Opus data sent to this channel (48000 sampling, 960 size) will be sent to Discord. NOTE it is possible this channel name could change as Voice is still a bit on the experimental side. 4b1baec
  • Added OnConnect and OnDisconnect event handlers 54e14ba
  • New() func now also accepts Token, User, and Pass together b5a4680
  • State tracking feature now also tracks messages bf20fff
  • Added funcs GuildSplash() and GuildIcon() b4dfce0

Breaking Changes

  • Changes to Login func will break existing uses of the function. Please use New() function if possible :). Otherwise, Login function no longer returns the Token, instead it stores the token directly into the Session.Token variable. b5a4680
  • Changes to New(), Open(), and Listen(). New() no longer opens a websocket connection, which allows you to use it for cases where you only need the restapi and also allows you to setup callback functions before you connect to the websocket. Listen() has been removed. Open() will now call Listen in a goroutine. 94b087c

Discord Broke Master.

12 Jan 14:40
Compare
Choose a tag to compare

Alright everybody! Here we are at v0.9.0 :) We've got 16 stars, 5 forks, and 5 contributors :) We're growing into something real here.

Lots of changes so as always check the commit history for more detail and be ready to make some "minor" changes to your code when you update your local copy. See some of the bigger, and breaking changes below.

  • Go Tests added! Not a lot but a few and we plan to keep adding more. At about 20% coverage now.
  • TravisCI now testing Go 1.3, 1.4,and 1.5 for us to make sure we compile on older versions.
  • New func, Register(username) lets you register a new account on Discord.
  • Message struct and added funcs now in message.go
  • Some cleanup to the built-in Voice support, should be a more stable API now.
  • BREAKING To join a voice channel you now must call ChannelVoiceJoin func.
  • BREAKING Some voice variables were hidden, some renamed, "V" prefixed voice stuff is now in Session.Voice.[var/func]
  • BREAKING All API and Event funcs were converted to use and return pointers.
  • BREAKING All funcs that only work for the authenticated user, now do not accept a userID variable. They default to "@me"
  • Voice now sends a udp keepalive packet, and paves the way to voice receive support
  • UserAvatar now returns an Image!
  • Added some initial support for dealing with Rate Limits.
  • Added support for message Attachments & Embeds
  • Added GUILD_SPLASH endpoint
  • Start of better logging! JSON Unmarshal errors now return a consistent factory error.