summary refs log tree commit diff
path: root/src/exampleFetch.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-01-01 22:26:20 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-01-01 22:26:20 +0100
commite5f35fbdf901387d82b285f41ec87b1d1d2b3a69 (patch)
tree49ec23da615b5cc116e5ca655693c1afaad05dac /src/exampleFetch.ts
parent:tada: standard client finished (diff)
downloadserver-e5f35fbdf901387d82b285f41ec87b1d1d2b3a69.tar.xz
:bug: fix
Diffstat (limited to 'src/exampleFetch.ts')
-rw-r--r--src/exampleFetch.ts52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/exampleFetch.ts b/src/exampleFetch.ts
new file mode 100644

index 00000000..9c433e4b --- /dev/null +++ b/src/exampleFetch.ts
@@ -0,0 +1,52 @@ +import fetch from "node-fetch"; + +fetch("https://discord.com/api/v8/auth/login", { + headers: { + authorization: "undefined", + "content-type": "application/json", + "x-fingerprint": "782364413927751692.ex9RorNkBsGynrJCe5Brxtc3Ytc", + "x-super-properties": + "eyJvcyI6Ik1hYyBPUyBYIiwiYnJvd3NlciI6IkNocm9tZSIsImRldmljZSI6IiIsImJyb3dzZXJfdXNlcl9hZ2VudCI6Ik1vemlsbGEvNS4wIChNYWNpbnRvc2g7IEludGVsIE1hYyBPUyBYIDEwXzE1XzcpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS84Ny4wLjQyODAuNjcgU2FmYXJpLzUzNy4zNiIsImJyb3dzZXJfdmVyc2lvbiI6Ijg3LjAuNDI4MC42NyIsIm9zX3ZlcnNpb24iOiIxMC4xNS43IiwicmVmZXJyZXIiOiIiLCJyZWZlcnJpbmdfZG9tYWluIjoiIiwicmVmZXJyZXJfY3VycmVudCI6IiIsInJlZmVycmluZ19kb21haW5fY3VycmVudCI6IiIsInJlbGVhc2VfY2hhbm5lbCI6InN0YWJsZSIsImNsaWVudF9idWlsZF9udW1iZXIiOjcyMzc2LCJjbGllbnRfZXZlbnRfc291cmNlIjpudWxsfQ==", + }, + body: JSON.stringify({ + login: "email@gmail.com", + password: "cleartextpassword", + undelete: false, + captcha_key: null, + login_source: null, + gift_code_sku_id: null, + }), + method: "POST", +}); +/** + * @returns {"token": null, "mfa": true, "sms": true, "ticket": "WzMxMTEyOTM1NzM2MjEzNTA0MSwibG9naW4iXQ.X8LHqg.vTwtZBaLu5W_XMMSvKad1OAaEoA"} + */ + +fetch("https://discord.com/api/v8/auth/mfa/totp", { + headers: { + authorization: "undefined", + "content-type": "application/json", + }, + body: JSON.stringify({ + code: "722608", + ticket: "WzMxMTEyOTM1NzM2MjEzNTA0MSwibG9naW4iXQ.X8LHqg.vTwtZBaLu5W_XMMSvKad1OAaEoA", + login_source: null, + gift_code_sku_id: null, + }), + method: "POST", +}); +/** + * @returns {"token": "mfa.-Rg2AwyP06YdTPmIDt0sqA92T8fBVITLTcXjP7zO_Uhgkg1FA0WERGjJXJyN_dyVDeBnxIWr0w3XiXW8YxVw", "user_settings": {"locale": "en-GB", "theme": "dark"}} + */ + +// token: mfa.-Rg2AwyP06YdTPmIDt0sqA92T8fBVITLTcXjP7zO_Uhgkg1FA0WERGjJXJyN_dyVDeBnxIWr0w3XiXW8YxVw + +fetch("https://discord.com/api/v8/gateway", { + headers: { + authorization: "token", + }, + method: "GET", +}); +/** + * @returns {"url": "wss://gateway.discord.gg"} + */