ClassiCube / MCGalaxy

A Minecraft Classic / ClassiCube server software
GNU General Public License v3.0
168 stars 79 forks source link

Discord relay websocket needs to be updated from v6 to v8 API #685

Closed UnknownShadow200 closed 2 years ago

UnknownShadow200 commented 2 years ago

version 6 api is scheduled for decommissioning on april 30, so need to update relay bot to use version 8 instead (Thanks 123DMWM)

UnknownShadow200 commented 2 years ago

Resolved by f8805bb1c0f6a6f637e1a5d48843ea08f7781c53

TheDinoDude commented 2 years ago

https://github.com/discord/discord-api-docs/discussions/4510 - according to this version 8 is deprecated so wouldn't it be wise to just update the relay api to v10 instead of v8

UnknownShadow200 commented 2 years ago

When I tried v10 API with my test relay bot, it no longer received content in messages received from discord. Had to add (1 << 15) to intents to be able to access message content now

Alas, enabling that intent resulted in the bot being immediately disconnected with error code 4014, as it is a privileged gateway intent

So had to go into the bot app settings and manually enable the message gate way intent there, and then the relay bot could finally access message content


So in the short term I went with the immediate solution of switching to v8 API, as that didn't require the owner needing to modify the relay bot's permissions. Properly preparing for v10 API switch will be done at some point in the future though

UnknownShadow200 commented 1 year ago

Seems that Discord has essentially retroactively made the same changes to v8 api after enforcing message content intent since end of August (you no longer get contents of messages in v8 api if you don't specify message content intent in connection intents, and you get disconnected with an error 4014 if message content intent is not enabled in the bot's settings)

So should update to v10 api now, as the reason for using v8 api no longer exists