About
A Discord library written in TypeScript for developers looking to interface directly with the Discord API with little to no abstractions.
Features
- Lightweight: Distype uses minimal dependencies, and is highly performant due to the absence of transforming raw data from Discord into complex structures and abstractions.
- Scalable: With a built-in sharding manager (that supports big bot sharding) and a focus on performance, Distype makes it easy to scale your bot.
- Predictable: Distype is as close as you can get to the Discord API, meaning that typically, what you see in Discord's documentation is also here.
- Modular: The cache manager, gateway manager, and rest manager can all be instantiated independently, allowing for super lightweight solutions.
- Fully Featured: Distype covers 100% of the Discord API, meaning that you'll never be missing out on any features.
- Highly Configurable: Distype aims to offer as much configuration as possible of its internals, such as fully controllable cache behavior, retry and rate limit behavior, custom rest and gateway base URLs for proxy solutions, access to low-level http and websocket options, and more.
Links
Related Packages
Example Bot
import { Client, LogCallback } from 'distype';
const logger: LogCallback = (message, { level }) => console.log(`${level} | ${message}`);
const client = new Client(YOUR_BOT_TOKEN, {}, logger);
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.
Installation
Distype can be installed via npm.
npm install distype
Prerequisites
Optional packages