Discord Protocol Buffers
Reverse-engineering Discord's protobufs.
This repository provides protocol buffer files for all protobufs found in Discord's client source, automatically generated and automatically updated. The protobufs are provided as .proto files in the out/ directory.
These protobufs are used by Discord clients for transmitting data like user settings and premium marketing.
Usage
Installation
Note: These packages are automatically updated when changes are detected in the protobufs. As Discord often updates their protobufs, pinning to a specific version may be advisable.
# with npm
npm install discord-protos
# with yarn
yarn add discord-protos
# with pnpm
pnpm add discord-protos
# with pip
pip install discord-protos
Example
JavaScript:
const { PreloadedUserSettings } = require('discord-protos');
const encoded = PreloadedUserSettings.toBase64({
status: {
status: {
value: "online",
},
customStatus: {
text: "Hello World",
emojiId: 0n,
emojiName: "",
expiresAtMs: 0n,
createdAtMs: 0n,
},
},
});
const decoded = PreloadedUserSettings.fromBase64(encoded);
console.log(encoded, decoded);
Python:
import base64
from google.protobuf.json_format import ParseDict
from discord_protos import PreloadedUserSettings
settings = PreloadedUserSettings()
payload = ParseDict({
'status': {
'status': 'online',
'custom_status': {
'text': 'Hello World',
},
},
}, settings).SerializeToString()
encoded = base64.b64encode(payload).decode('ascii')
decoded = PreloadedUserSettings.FromString(base64.b64decode(encoded))
print(encoded, decoded, sep='\n')
The following table shows which protobuf user settings correspond to which .proto file (the Python package also provides a UserSettingsType enum for convenience).
| Type | Value | File | Use |
|---|---|---|---|
| 1 | PRELOADED_USER_SETTINGS |
PreloadedUserSettings.proto | General Discord user settings. |
| 2 | FRECENCY_AND_FAVORITES_SETTINGS |
FrecencyUserSettings.proto | Frecency and favorites storage for various things. |
| 3 | TEST_SETTINGS |
- | Unknown. |
See Userdoccers for more information.
Development
Running pnpm load will extract and save the latest protobufs to the discord_protos/ directory.
Release files for discord-protos 1.2.324
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| discord_protos-1.2.324.tar.gz | 206.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| discord_protos-1.2.324-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 442.4 kB
Release files / discord_protos-1.2.324.tar.gz
| Download URL | discord_protos-1.2.324.tar.gz |
|---|---|
| Size | 206.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73cfa9edc2d90ba70c8cdfc02a4d65ce4ca6a56fa5dcfea957384165928df691
|
|
BLAKE2b-256 checksum How to use checksums |
b950f7dae8a306df8aeffa5641feeb1e3de28f0f8ac65d0c9e60c1b97f0a6aa4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / discord_protos-1.2.324-py3-none-any.whl
| Download URL | discord_protos-1.2.324-py3-none-any.whl |
|---|---|
| Size | 236.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ecab2f962a72e9c0a1dbdc44ccec789a00de9db4edcdd336800c2190cdcd752f
|
|
BLAKE2b-256 checksum How to use checksums |
0e8ed88667e6be1772e05fc6a7f2628c4cf5d5cc0b0b13f8e77d796d337c2e07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency log