An open API service indexing awesome lists of open source software.

https://github.com/keiryojs/keiryo

🚀 a distributed discord library
https://github.com/keiryojs/keiryo

api caching cdn discord discord-api discord-gateway discord-libraries flexible nodejs rest typescript voice

Last synced: 3 months ago
JSON representation

🚀 a distributed discord library

Awesome Lists containing this project

README

          

---

> NeoCord is currently in alpha, meaning it will probably be broken and might not work.
If you want to contribute, please join our [support server](https://discord.gg/5WD9KhF) - It would be greatly appreciated.

###### Table of Contents

- [about](#about)
- [installation](#installation)
- [optional packages](#option-packages)
- [basic usage](#basic-usage)

About

Neocord is a powerful and feature-rich discord library.

- **Flexible**: Gives you the ability to extend specific structures, customize caching to your needs.
- **Coverage**: Covers the Discord Gateway, API, CDN, and in the near future, Voice.
- **Caching**: Boasts the most powerful and flexible caching solution across most discord libraries.

## Installation

As of **09/04/2020** (month/day/year), NeoCord can only be used with node.js v12 and up.

```shell script
yarn add neocord
```

##### Optional Packages

These are some optional packages you can install.

- Install **zlib-sync** or **pako** for data compression and inflation
> - **[zlib-sync](https://npmjs.com/zlib-sync/)**
> - **[pako](https://npmjs.com/pako/)**
> - or the native **zlib** module (no installation)

- **[erlpack](https://npmjs.com/erlpack)** for significantly faster websocket (de)serialization.
- **[bufferutil](https://npmjs.com/bufferutil)** for a much faster websocket connection.
> And **[utf-8-validate](https://npmjs.com/utf-8-validate)** for faster websocket processing.

##### Basic Usage

`(typescript)`
```ts
import { Client } from "neocord";

const client = new Client();

client
.on("ready", () => console.log("Now ready!"))
.on("messageCreate", (message) => {
if (message.author.bot) return;

const mentionPrefix = new RegExp(`^<@!${client.user.id}>\s*`);

let prefix;
if (message.content.startsWith("!")) prefix = "!"
else {
const mentioned = mentionPrefix.exec(message.content);
if (!mentioned) return;
prefix = mentioned[0];
}

const [cmd] = message.content.slice(prefix.length).split(/ /g);
if (cmd.toLowerCase() === "ping") {
message.channel.send("**Pong!**");
}

return;
});

client.connect("your token here");
```

## Links

- **Support Server**: [discord.gg/5WD9KhF](https://discord.gg/5WD9KhF)
- **Github**:
- **NPM**:

---

melike2d © 2020