{"id":23544,"library":"discord-protos","title":"Discord Protos","description":"Type stubs and Python bindings for Discord's internal protobuf definitions used in user settings and account data. Version 1.2.183 is the latest, following Discord's internal proto changes closely. Released on PyPI with no fixed cadence.","status":"active","version":"1.2.183","language":"python","source_language":"en","source_url":"https://github.com/dolfies/discord-protos","tags":["discord","protobuf","user-settings","serialization"],"install":[{"cmd":"pip install discord-protos","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Runtime dependency for protobuf message classes","package":"protobuf","optional":false},{"reason":"Used for generating async-friendly protobuf types (optional if using pure protobuf)","package":"betterproto","optional":true}],"imports":[{"note":"Wrong import path; classes are under submodules.","wrong":"from discord_protos import UserSettings","symbol":"UserSettings","correct":"from discord_protos.user_settings import UserSettings"},{"note":"","wrong":"","symbol":"UserSettingsProto","correct":"from discord_protos.user_settings import UserSettingsProto"}],"quickstart":{"code":"import os\nfrom discord_protos.user_settings import UserSettings\n\n# Load serialized protobuf bytes\nwith open('user_settings.bin', 'rb') as f:\n    data = f.read()\nsettings = UserSettings()\nsettings.ParseFromString(data)\nprint(settings.discord_status)\nprint(settings.theme)","lang":"python","description":"Deserialize a Discord user settings protobuf from file bytes."},"warnings":[{"fix":"Use `from discord_protos.<submodule> import <Class>` matching the proto file name.","message":"Direct import of protobuf classes from top-level package fails; use submodule paths.","severity":"breaking","affected_versions":"all"},{"fix":"Consider forking or using the protos from the official Discord data exports directly.","message":"The package may be abandoned; last update was June 2023 and no commit since.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Always check the .proto files or generated Python stubs for exact field names.","message":"Protobuf field names use snake_case (e.g., `discord_status`) not camelCase as in JavaScript.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from discord_protos.user_settings import UserSettings`.","cause":"Top-level import instead of submodule import.","error":"ImportError: cannot import name 'UserSettings' from 'discord_protos'"},{"fix":"Use snake_case field names like `discord_status`.","cause":"Using camelCase field names from JavaScript protobuf docs.","error":"AttributeError: 'UserSettings' object has no attribute 'discordStatus'"},{"fix":"Create an empty message and assign fields: `msg = SomeMessage(); msg.field = value`.","cause":"Passing keyword arguments directly; protobuf messages do not accept constructor kwargs in Python.","error":"TypeError: __init__() got an unexpected keyword argument 'message_ttl_days'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}