This package has been deprecated

Author message:

The distype package is no longer supported. Please use @distype/client or other packages in the distype workspace instead.

distype
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published



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 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.

Installation

Distype can be installed via npm.

npm install distype

Prerequisites

Optional packages

Package Sidebar

Install

npm i distype

Weekly Downloads

45

Version

2.0.0

License

Apache-2.0

Unpacked Size

387 kB

Total Files

41

Last publish

Collaborators

  • br88c