Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import WebSocket from "ws";
- import * as os from "os";
- // this code is NOT how libraries do it, there is MUCH more to this, the gateway url must be fetched every time you launch a client, shards are automatically spawned, not manually filled in, etc
- const ws = new WebSocket("wss://gateway.discord.gg?v=6");
- ws
- .on("message", (m) => {
- console.log(m.toString());
- ws.send(JSON.stringify({
- op: 2,
- d: {
- token: "as if",
- properties: {
- $os: os.type(),
- $browser: "OwO",
- $device: "OwO"
- },
- compress: false,
- shard: [0, 1]
- }
- }));
- })
- .on("error", (e) => console.error(e))
- .on("close", (e, r) => console.error("Unclean WS Close: %s %s", e, r));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement