documentation
modifyself client library — chrome154 discord header emulation over an encrypted api.
installation
one-line install via curl:
curl -fsSL modifyself.com/modifyself | sh
or with jerk, after the first install:
jerk pull modifyself.com/modifyself
this installs modifyselfclient, jerk, and dependencies (PyNaCl, msgpack, httpx).
quickstart
from modifyselfclient import Spoofer import asyncio, json import websockets sp = Spoofer('your.discord.token') # rest headers headers = sp.get_headers() # gateway connection async def connect(): ws_headers = sp.get_websocket_headers() identify = sp.get_gateway_identify() async with websockets.connect( 'wss://gateway.discord.gg/?v=10&encoding=json', additional_headers=ws_headers ) as ws: json.loads(await ws.recv()) # op 10 hello await ws.send(json.dumps(identify)) # op 2 identify ready = json.loads(await ws.recv()) # op 0 READY asyncio.run(connect())
Spoofer class
Spoofer(token: str, api: str = 'https://modifyself.com')
token— your discord user tokenapi— api base url (override for self-hosted)
on init, the client generates an ephemeral x25519 keypair and fetches the server's public key. every subsequent call rides that encrypted session.
get_headers()
returns a dict of rest headers for any http client.
headers = sp.get_headers() import httpx r = httpx.get('https://discord.com/api/v10/users/@me', headers=headers)
get_gateway_identify()
get_gateway_identify(status='online', afk=False, activities=None) -> dict
returns the full op=2 identify payload. send it straight to the gateway with json.dumps().
| param | type | description |
|---|---|---|
| status | str | online / idle / dnd / invisible |
| afk | bool | presence afk flag |
| activities | list | presence activities list |
get_websocket_headers()
returns a dict of headers for the websocket upgrade. pass as additional_headers to websockets.connect.
encryption model
your token never travels in plaintext. not to cloudflare, not to any proxy. x25519 diffie-hellman + xsalsa20-poly1305 means only the server's private key can decrypt it.
per-session flow:
- client generates an ephemeral x25519 keypair on
Spoofer()init - the server's static public key is fetched once from
/pubkey - each call encrypts the token with nacl.Box(client_priv, server_pub)
- server decrypts, builds the payload, re-encrypts the response
- client decrypts the binary blob, deserializes msgpack
updating
build numbers and identify structure auto-update server-side — no client change needed for discord deploys. to update the library itself:
jerk pull modifyself.com/modifyself