You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What: Updates the Discord client to use version 10 of the Discord API and account for its quirks/changes.
Why: The version of the Discord API was very old and will likely stop working in the near future. Plus it's good to do as general maintenance.
Notes:
Discord seems to waffle between sending us integers and strings for permissions bitfield values depending on what permission level you are (e.g. users with room owner permissions seemed to have integers sent, but non-privileged users seemed to have strings sent), so this had to be accounted for by testing whether the value was a string or not and converting any strings to integers.
Discord has changed and usernames for people are now enforced to be unique and the discriminator numbers aren't appended to the end anymore (Discord bots still use discriminators, but this isn't relevant to us).
https://discord.fandom.com/wiki/Discriminator
# Note: Whether the bitfield values in guild_roles are represented as strings or integers is inconsistent (possibly based on what permissions the user has), so every time they're used they need to be checked and, if needed, converted to integers.
@@ -190,12 +195,15 @@ defmodule Ret.DiscordClient do
190
195
|>Map.get("permission_overwrites")
191
196
|>Map.new(&{&1["id"],&1})
192
197
end
198
+
# Note: Whether the bitfield values in channel_overwrites are represented as strings or integers is inconsistent (possibly based on what permissions the user has), so every time they're used they need to be checked and, if needed, converted to integers.
0 commit comments