discord-gateways is a module that connects to Discord Gateways over Websockets and emits events on each Discord Intent.
- MESSAGE_CREATE
npm install discord-gateways
- Login to your Discord account from your browser.
- Enable
Developer Toolsusing [Ctrl]+[Shift]+[I] key combination on Google Chrome. - Go to
Networktab. - Send a message to anyone.
- Select the
messagespacket, make sure thatHeaderstab is selected, and scroll down to find and copy theauthorizationheader under theRequest Headers.
import { DiscordClient, MessageDto } from 'discord-gateways';
const client = new DiscordClient("DISCORD_TOKEN");
client.on("messageCreate", (message: MessageDto) => {
console.log(message);
});
client.connect();
Please read the contribution guide before submit a PR.