This package has been deprecated

Author message:

see https://github.com/cordis-lib/cordis#deprecation

@cordis/gateway
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

@cordis/gateway

GitHub npm TypeScript

The cordis WS client for Discord's API.

Installation

  • npm install @cordis/gateway
  • pnpm install @cordis/gateway
  • yarn add @cordis/gateway

Example Usage

const { Cluster } = require('@cordis/gateway');

const main = async () => {
  const manager = new Cluster('token');

  manager
    .on('ready', () => console.log('Hello world!'))
    .on('dispatch', ({ t, d }) => {
      switch (t) {
        case 'MESSAGE_CREATE': {
          if (d.content === '!ping') console.log('pong!');
          break;
        }

        default: break;
      }
    });

  await manager.connect();
};

main();

Documentation

You can find documentation for the whole project over at https://cordis.js.org

Contributing

Please see the main README.md for info on how to contribute to this package or the other @cordis packages.

LICENSE

Licensed under the Apache 2.0 license.

Readme

Keywords

none

Package Sidebar

Install

npm i @cordis/gateway

Weekly Downloads

37

Version

1.2.0

License

none

Unpacked Size

42.6 kB

Total Files

15

Last publish

Collaborators

  • didinele