Skip to content

Move properties transmitted in identify to variable on DiscordWebSocket - #10513

Open
pythonmcpi wants to merge 1 commit into
Rapptz:masterfrom
pythonmcpi:internal_identify_properties
Open

pythonmcpi wants to merge 1 commit into
Rapptz:masterfrom
pythonmcpi:internal_identify_properties

Conversation

@pythonmcpi

@pythonmcpi pythonmcpi commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Moves the client properties sent in websocket IDENTIFY to a variable on DiscordWebSocket. This makes overriding them easier, and more specifically discourages monkeypatching out the whole identify method, which can break things when the library updates.

Originally suggested by Soheab in this bikeshedding thread.

This is intentionally not documented as bots being able to change these properties is not something Discord documents or officially supports.

Snippet for applying mobile status after this change:

import sys
from discord.gateway import _set_identify_properties
_set_identify_properties({
    "os": sys.platform,
    "browser": "Discord Android",
    "device": "Discord Android",
})

# alternatively:
from discord.gateway import DiscordWebSocket
DiscordWebSocket.IDENTIFY_PROPERTIES.update({
    "browser": "Discord Android",
    "device": "Discord Android",
})

Snippet for applying VR status after this change:

import sys
from discord.gateway import _set_identify_properties
_set_identify_properties({
    "os": sys.platform,
    "browser": "Discord VR",
    "device": "oculus",
})

# alternatively:
from discord.gateway import DiscordWebSocket
DiscordWebSocket.IDENTIFY_PROPERTIES.update({
    "browser": "Discord VR",
    "device": "oculus",
})

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant