discordgo icon indicating copy to clipboard operation
discordgo copied to clipboard

Adding support for Gateway Intents, possibly resulting in majorly breaking code

Open JurrijnP opened this issue 4 years ago • 0 comments

Discord introduced a new way to limit your event data called Gateway Intents. You can read more about it here: https://discordapp.com/developers/docs/topics/gateway#gateway-intents

You need to provide the gateway intents in the identify payload, which is not exposed in any way in DiscordGo. The gateway intents are optional in gateway version 6, but mandatory in version 7. The easy route would be to add another field in the Session struct to define the intents but that reveals an underlying issue which has been brought up before. Ideally you would be able to directly access the indentify function with the data you want to provide or something in that direction. @diamondburned & I discussed a bit about this issue and came the conclusion it would be best to make this change the breaking change that not only changes the identify function, but the whole structure of connecting all together that has been up for debate before.

I am mainly talking about the New() & Open() function. As this would break the code of every single user of DiscordGo in the end I would like @bwmarrin to comment on this. :+1:

JurrijnP avatar Feb 29 '20 16:02 JurrijnP