nisus
v1.1.16
Published
<br>Insanely easy to use but advanced discord.js command handler</br>
Downloads
5
Maintainers
Readme
Insanely easy to use but advanced discord.js command handler
Installation
npm i nisus
Setup
const Discord = require('discord.js');
const nisus = require('nisus');
const client = new Discord.Client();
new nisus(client, {
commandsFolder: './commands', // commands folder
eventsFolder: './events', // events folder
token: 'Your Super Secret Token', // your discord bot token
prefix: 'Bot Prefix', // your bot prefix
owners: [''], // array of the bot owners,
mongoURI: '' // your mongodb connection string (optional)
})
Command layout
module.exports = {
name: '', // command name | type: String
aliases: [], // command aliases | type: Array
ownerOnly: false, // exclusive to owner only | type: Boolean
guildOnly: false, // exclusive to guild only (cannot be used in DMs) | type: Boolean
nsfw: false, // command can only be used in NSFW channels | type: Boolean
disabled: false, // disables/enables the command to be used | type: Boolean
userPerms: [], // user required permissions | type: Array
botPerms: [], // bot required permissions | type: Array
requiredRoles: [], // user required roles | type: Array
requiredChannel: '', // only channel where the command can be used | type: String
callback: (message, args, client) => {
/*
Your code here
*/
}
}
Example Command
// example command: ping command
module.exports = {
name: 'ping',
aliases: ['p'],
ownerOnly: false,
guildOnly: false,
nsfw: false,
disabled: false,
callback: (message, args, client) => {
message.channel.send('Pong!')
}
}
Events layout
// file name = event name, eg: file name is message.js which means its a message event
module.exports = (client, <EVENT PARAMS>) => {
/*
Your code here
*/
}
Example event
// message event
module.exports = (client, message) => {
console.log(message.content)
}