NPM Modules

Simply use npm within the Custom Commands directory to install any package(s) you would like.

Installation

  1. Firstly, open up a console navigated to the Custom Commands directory.

  2. Run the command npm init -y

  3. Now you can install any module you want, for example npm install coinflip


Usage

You can now require it just like you would any other npm module.

const coinflip= require("coinflip")

module.exports = {
   name: "flipcoin",
   description: "Flips a coin",
   usage: "flipcoin",
   useronly: false,
   execute(client, message, args) {
       message.channel.send(coinflip() ? "Heads!" : "Tails!");   
  },
};

Last updated