Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permissions in audit log gateway event are serialized as numbers instead of strings #6616

Open
Tmpod opened this issue Jan 11, 2024 · 2 comments
Labels
bug synced Synced to internal tracker

Comments

@Tmpod
Copy link

Tmpod commented Jan 11, 2024

Description

The docs state the following about permissions:

Permissions are stored in a variable-length integer serialized into a string, and are calculated using bitwise operations.
[...]
In API v8 and above, all permissions are serialized as strings, including the allow and deny fields in overwrites.
[...]
In API v6 (now deprecated), the permissions, allow, and deny fields in roles and overwrites are still serialized as a number

However, when receiving GUILD_AUDIT_LOG_ENTRY_CREATE events, these fields do come as integers.

This didn't seem to be the case before (I'm only noticing these errors on my bot now, at least), but I haven't tested enough to see if it's an audit log only thing.

Steps to Reproduce

  1. Change a role's permissions for a channel
  2. Receive a payload like this:
{"t":"GUILD_AUDIT_LOG_ENTRY_CREATE","s":17,"op":0,"d":{"user_id":"","target_id":"","options":{"type":"0","role_name":"","id":""},"id":"","changes":[{"new_value":"","key":"id"},{"new_value":0,"key":"type"},{"new_value":1024,"key":"allow"},{"new_value":0,"key":"deny"}],"action_type":13,"guild_id":""}}

(redacted IDs and role name)

Expected Behavior

Permissions should come serialized as strings.

Current Behavior

Permissions come serialized as numbers.

Screenshots/Videos

No response

Client and System Information

Kord
Linux 64-bit

@Tmpod Tmpod added the bug label Jan 11, 2024
@Misha-133
Copy link
Contributor

#6493
related (most likely) issue

@Tmpod
Copy link
Author

Tmpod commented Jan 11, 2024 via email

@ykogan-discord ykogan-discord added the synced Synced to internal tracker label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug synced Synced to internal tracker
Projects
None yet
Development

No branches or pull requests

3 participants