v0.30.0
Big release
Features:
- replaced rest builder methods with the tradition struct parameter (eg.
Channel(id).UpdateBulder(..) => Channel(id).Update(*UpdateChannel)
- add events
- GUILD_SCHEDULED_EVENT_CREATE
- GUILD_SCHEDULED_EVENT_UPDATE
- GUILD_SCHEDULED_EVENT_DELETE
- GUILD_SCHEDULED_EVENT_USER_ADD
- GUILD_SCHEDULED_EVENT_USER_REMOVE
- THREAD_CREATE
- THREAD_UPDATE
- THREAD_DELETE
- THREAD_LIST_SYNC
- THREAD_MEMBER_UPDATE
- THREAD_MEMBERS_UPDATE
- GUILD_STICKERS_UPDATE
- INTERACTION_CREATE
- shorter REST arguments (deprecated the
Params
suffix) Config.RejectEvents
andConfig.DMIntents
are deprecated in favor ofConfig.Intents
- renamed
KickVoiceParticipant
=>DisconnectVoiceParticipant
to clarify intent - More consistency for errors, making it easier to use errors.Is when utilizing the REST methods (local failures only)
- slash commands / application commands support!
- Thread support!
Intents
There has been some confusion around RejectEvents and DMIntents. They aren't mutually exclusive, and with privileged events/intents, it makes more sense to explicitly specify which events/intents the bot requires instead.
Currently I will only support setting intents, for simplicity sake. Later I might add an alternative, but the Config.Intents
field is there to stay, unless Discord deprecated the feature.
REST update methods
Until now, Disgord has been using the builder pattern to allow sending default values. See more here: #420
This has been replaced in favor of the typical struct argument, to make methods more consistent and ease maintenance (the code generation was a bit too magical).
newChannelName := "new channel name"
// before
channel, err := client.Channel(23).UpdateBuilder().
SetTitle(newChannelName).
Execute()
// after
channel, err := client.Channel(23).Update(&UpdateChannel{
Title: &newChannelName, // note the pointer value
})
breaking changes
I strongly encourage everyone to explicitly set intents in the config. Upgrading to a later release might cause your bot to not work as all intents are enabled by default in earlier Disgord versions.
Breaking:
Client.Channel(..).CreateInvite(..)
is no longer a builder and takes aCreateInvite
struct.Client.Channel(..).Update(..)
no longer has a reason parameterClient.Guild(..).Role(..).Update(..)
no longer has a reason parameterClient.Guild(..).PruneMembers(..)
- no longer has a reason parameter
- returns a prune count
- InteractionCallbackType constant received a
InteractionCallback
prefix (disgord.Pong
=>disgord.InteractionCallbackPong
) - removed build tag
disgordperf
- thread methods were restrctured (breaking only for people depending on the master branch)
- Emoji(..).Update(..) method no longer has a reason parameter
I hope I have covered everything!
See v0.29.0...v0.30.0 for more information
Thanks to the contributors:
- introducing threads
- application commands
- reporting bugs
- discussing design choices