# @cordis/gateway

> The cordis gateway to Discord

Latest version **1.2.0** (published 2021-11-24) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @cordis/gateway
pnpm add @cordis/gateway
yarn add @cordis/gateway
bun add @cordis/gateway
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2021-11-24 |
| First published | 2021-02-24 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 <=16.11.1 |
| Dependencies | 9 |
| Unpacked size | 41.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Maintainers | didinele |

## Links

- npm: https://www.npmjs.com/package/@cordis/gateway
- Repository: https://github.com/cordis-lib/cordis
- Homepage: https://github.com/cordis-lib/cordis#readme
- Issues: https://github.com/cordis-lib/cordis/issues
- npm.io page: https://npm.io/package/@cordis/gateway

## Dependencies (9)

- [ws](https://npm.io/package/ws.md) ^7.5.6
- [tslib](https://npm.io/package/tslib.md) ^2.3.1
- [common-tags](https://npm.io/package/common-tags.md) ^1.8.2
- [@cordis/rest](https://npm.io/package/@cordis/rest.md) ^1.2.0
- [@cordis/error](https://npm.io/package/@cordis/error.md) ^1.2.0
- [@cordis/queue](https://npm.io/package/@cordis/queue.md) ^1.2.0
- [@cordis/common](https://npm.io/package/@cordis/common.md) ^1.2.0
- [@cordis/bitfield](https://npm.io/package/@cordis/bitfield.md) ^1.2.0
- [discord-api-types](https://npm.io/package/discord-api-types.md) ^0.24.0

## Recent versions

- 1.2.0 (latest) — 2021-11-24
- 1.0.2-next.0dee995.1633708415 (next) — 2021-10-08
- 1.0.2-next.2616696.163369938 — 2021-10-08
- 1.0.2-next.2616696.1632048891 — 2021-09-19
- 1.0.2-next.2616696.1632048206 — 2021-09-19
- 1.0.2-next.613f2c2.1629835119 — 2021-08-24
- 1.0.2-next.8821b3c.1629831957 — 2021-08-24
- 1.0.1 — 2021-07-23
- 1.0.0 — 2021-07-22
- 0.3.0 — 2021-05-04
- 0.2.3 — 2021-03-21
- 0.2.0 — 2021-03-14
- 0.1.7 — 2021-03-07
- 0.1.6 — 2021-02-28
- 0.1.5 — 2021-02-25
- … 3 more at https://npm.io/package/@cordis/gateway/versions

## README

# `@cordis/gateway`  

[![GitHub](https://img.shields.io/badge/License-Apache%202.0-yellow.svg)](https://github.com/cordis-lib/cordis/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/v/@cordis/gateway?color=crimson&logo=npm)](https://www.npmjs.com/package/@cordis/gateway)
[![TypeScript](https://github.com/cordis-lib/cordis/actions/workflows/quality.yml/badge.svg)](https://github.com/cordis-lib/cordis/actions/workflows/quality.yml)

The cordis WS client for Discord's API.

## Installation
- `npm install @cordis/gateway` 
- `pnpm install @cordis/gateway` 
- `yarn add @cordis/gateway`

## Example Usage
```ts
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](https://github.com/cordis-lib/cordis) for info on how to contribute to this package or the other `@cordis` packages.

## LICENSE
Licensed under the [Apache 2.0](https://github.com/cordis-lib/cordis/blob/main/LICENSE) license.

---
_Source: https://npm.io/package/@cordis/gateway · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
