2.2.0 • Published 5 years ago
george-bomb v2.2.0
George-Bomb
George Bomb is a command handler for eris, it's made to be as easy and straighforward as possible!
Example
const { token } = require('./config.json')
const George = require('george-bomb')
// Initialises a George istance
const bot = new George({
prefix: ['!', '?'], // What's your bot's prefix?
token: "Your token here",
botProtection: true, // can other bots use your bot?
author: "Your ID here",
blacklist: ['IDs of', 'very mean', 'users here!'],
serverBlacklist: ['IDs of bad servers here!'],
whitelist: ["Who can use your bot's id here"], // If you make one, the bot will interact only with the users who are in this list
serverWhitelist: ["Servers' IDs here!"], // If you make one, the bot will work only on this servers!
timeout: 2500 // Milliseconds inbetween any interaction with a user
})
// Adds a command
bot.addCommand( 'ping', (msg, args) => {
msg.channel.createMessage('This is your first arg: ' + args[0])
})
Separating each command into its own file
When you initialise an istance of george bomb, it will seek the commands
folder and the callbacks
folder, and it will add the files in them as commands
Commands folder
- Make a folder called
commands
in your project folder - Make a file called
com-<command-name>.js
- Code stuff into it, remembering that every command has two arguments, the message argument and an array containing all the provided arguments, each one separated by a space. to see how a file has to be structured, see the example file.
- Have fun!