Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more

πŸ’Ž Keystone

A WIP library providing simple, low-level wrappers for the Discord API.

Keystone is a minimal library to help you interact with the Discord API. It provides separate wrappers for the gateway and REST endpoints, and is inspired by libraries like ↗️ detritus.js.

Usage

import { GatewaySocket, Packet } from "https://deno.land/x/keystone/ws/mod.ts";

const socket = new GatewaySocket({
  intents: 32509,
  token: "MY DISCORD TOKEN",
});

socket.addEventListener("dispatch", (evt: CustomEvent<Packet>) => {
  const { d, t } = evt.detail;
  if (t === "MESSAGE_CREATE") {
    console.log(d.content);
  }
});

socket.connect();