1.0.11 • Published 1 year ago

rx-discord-client v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Reactive discord client

How to use

Install dependency

npm install --save rx-discord-client

Use the reactive client to log all messages, filter by created and print all messages

import {DiscordClient} from 'rx-discord-client';


DiscordClient.create("some.authorization.token")
    .pipe(
        tap(msg => console.log(`[${new Date().toISOString()}] `, `Received message of type [${msg.type}]`)),
        filter(msg => msg.type === 'MESSAGE_CREATE')
    )
    .subscribe((msg) => console.log(JSON.stringify(msg.data)));

How to obtain the authorization token

  • Login on the discord web app in Google Chrome
  • Press F12 to open the developer console on the "Network" tab
  • Start typing in a server, and then wait for the request with the name "typing" in the developer console
  • Open the request and find the "authorization" header under "Request Headers"

The value of that header should be used as "some.authorization.token" in this example

Implementation example can be found on GitLab In this example all newly created messages will be saved in a mongo database.

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago