NPM Modules
Simply use npm within the Custom Commands directory to install any package(s) you would like.
Installation
Firstly, open up a console navigated to the Custom Commands directory.
Run the command
npm init -y
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!");
},
};
Packages that depend on modules such as canvas that cannot be compiled due to Electron incompatibility and cause errors on selfbot start.
Last updated