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 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
.
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.