Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discord-slim

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-slim

Lightweight Discord client for Node.js.

  • 2.0.0-dev.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Discord Slim

V2 IS UNDER DEVELOPMENT!

Contains breaking changes and incompatible with V1.
API is unfinished and may be changed with further updates.

V2 main features

  • Typed actions API instead of manual requests.
  • Typed events API instead of manual packet handling.
  • Actions is now independent from the client.

Support & suggestions server

https://discord.gg/drsXkP8R4h

Before you start

Node.js 12+ is required!

Make sure you have some understaning of Discord API.

Installation

Note: this version is unstable!

npm i discord-slim@dev

Usage example

const
    Discord = require('discord-slim'),
    Actions = Discord.Actions,
    Events = Discord.Helpers.Events,
    Intents = Discord.Helpers.Intents,
    client = new Discord.Client(),
    authorization = new Discord.Authorization('token'),
    requestOptions = { authorization };

client.events.on(Events.MESSAGE_CREATE, (message) => {
    if(message.author.id == client.user.id) return;
    if(message.content.toLowerCase().indexOf('hello bot') < 0) return;
    Actions.Message.Create(message.channel_id, { content: `Hi, <@${message.author.id}>!` }, requestOptions);
});

client.Connect(authorization, Intents.GUILDS | Intents.GUILD_MESSAGES);

Build from source

Install typescript package from npm and run tsc.

FAQs

Package last updated on 27 Mar 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc