import { DiscordIPC } from "https://deno.land/x/discord_rpc@0.3.0/mod.ts";
Constructors
new
DiscordIPC(conn: Deno.Conn)Methods
close()
Closes the connection to Discord IPC Socket and any open ReadableStreams for events.
login(clientID: string)
Performs initial handshake.
Send a packet to Discord IPC. Returns nonce.
Nonce is generated if the payload does not have a nonce
property
and is added to payload object too.
If payload object does contain a nonce, then it is returned instead.
sendCommand<T = unknown, T2 extends Record<string, unknown> = Record<string, unknown>>(): Promise<T>
Sends a Managed Command to Discord IPC.
Managed means it resolves when Discord sends back some response, or rejects when an ERROR event is DISPATCHed instead.
[Symbol.asyncIterator](): AsyncIterableIterator<IPCEvent>