discord-gateways
v1.0.2
Published
Connects to Discord Gateway through websocket and emits events on each Discord Intent
Downloads
10
Readme
discord-gateways
About
discord-gateways is a module that connects to Discord Gateways over Websockets and emits events on each Discord Intent.
Supported Discord Intents
- MESSAGE_CREATE
Installation
npm install discord-gateways
How to get your Discord authentication token
- Login to your Discord account from your browser.
- Enable
Developer Tools
using [Ctrl]+[Shift]+[I] key combination on Google Chrome. - Go to
Network
tab. - Send a message to anyone.
- Select the
messages
packet, make sure thatHeaders
tab is selected, and scroll down to find and copy theauthorization
header under theRequest Headers
.
Usage
import { DiscordClient, MessageDto } from 'discord-gateways';
const client = new DiscordClient("DISCORD_TOKEN");
client.on("messageCreate", (message: MessageDto) => {
console.log(message);
});
client.connect();
Contributing
Please read the contribution guide before submit a PR.