🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

diseasy

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diseasy

An easy-to-use Discord client

latest
Source
npmnpm
Version
0.3.4
Version published
Maintainers
1
Created
Source

diseasy

An easy-to-use Discord client.

Installation

npm install diseasy

Usage

Just create a discord object, and make requests to Discord's HTTP API.

const discord = require('diseasy')({ token: 'xyz' });

discord.post('/channels/123/messages')
  .send({ content: 'Hello world!' })
  .end();

You can make any type of request (GET, POST, DELETE, etc.), and each corresponding method returns a superagent request object. Learn about superagent requests here.

You can also access the Gateway WebSocket API.

const message = await discord.gateway()
  .filter(({ event }) => event === 'MESSAGE_CREATE');
  .find(({ data }) => data.content === 'I summon you, bot!');

The gateway() method returns a River, which is a high-level async iterable object. Heartbeats, session resumes, and other necessary ritual are automatically handled for you.

To learn more about the different kinds of events you can receive, read here.

Keywords

discord

FAQs

Package last updated on 12 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts