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

rcommands

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rcommands

A powerfull command handler for [discord.js](https://discord.js.org) bots [![NPM](https://nodei.co/npm/rcommands.png)](https://nodei.co/npm/rcommands/)

  • 1.1.0
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

RCommands

A powerfull command handler for discord.js bots NPM

Navigation

Installation

NPM

npm install rcommands

Setup

After you successfully installed RCommands, you need to implement it to your bot. To do so:

const { Client } = require("discord.js")
const RCommands = require("rcommands")
const client = new Client()

const db = {
    dbOptions: {
        useNewUrlParser: true,
        useUnifiedTopology: true,
        useFindAndModify: false,
        keepAlive: true,
    },
    mongoPath: "mongodb://..." // your mongodb connection uri
}

client.on("ready", () => {
    new RCommands(client, { // initialize a new RCommands instance
        cmdsDir: "commands", // your commands folder
        db,
        disabledDefaultCommands: [
            // notfound-error,
            // help,
            // etc..
        ]
    })
    .setDefaultPrefix("!")
})

client.login("your discord app token")

Creating Commands

Now its time to create a simple ping command

// file name: ping.js
// folder: commands

module.exports = {
    name: "ping",
    aliases: ["p"], // optional
    execute: (client, message, args, rClient) => {
        message.channel.send(`${client.ws.ping}ms!`)
    }
}

Keywords

FAQs

Package last updated on 05 Apr 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