A Discord library written in TypeScript for developers looking to interface directly with the Discord API with little to no abstractions.
APACHE-2.0 License
A Discord library written in TypeScript for developers looking to interface directly with the Discord API with little to no abstractions.
// Import Distype and logging typings.
import { Client, LogCallback } from 'distype';
// Distype pushes logging events through callbacks, and allows you to define your own logger.
const logger: LogCallback = (message, { level }) => console.log(`${level} | ${message}`);
// Creates the client. The client creates a cache, gateway, and rest manager. The first parameter is your
// bot's token, followed by client options, then finally the log callback.
const client = new Client(YOUR_BOT_TOKEN, {}, logger);
// This connects the client to the gateway.
client.gateway.connect();
Note that Discord API typings are for API version
10
, and are from discord-api-types. While you can still specify different API versions to be used, it is not recommended.
Distype can be installed via npm.
npm install distype