1.0.2 • Published 8 months ago

discord-gateways v1.0.2

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
8 months ago

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

  1. Login to your Discord account from your browser.
  2. Enable Developer Tools using Ctrl+Shift+I key combination on Google Chrome.
  3. Go to Network tab.
  4. Send a message to anyone.
  5. Select the messages packet, make sure that Headers tab is selected, and scroll down to find and copy the authorization header under the Request Headers. alt text

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.