A Discord bot framework for JavaScript and the Eris library.
npm install eris-boiler
The discord chat is the best place to communicate. We encourage using it for:
- Asking for help
- Asking if something is a bug
- Proposing ideas
- And anything else you can think of
Class documentation can be found here
// index.js
const { DataClient } = require('eris-boiler')
const token = 'MY TOKEN'
const bot = new DataClient({
token,
qbOptions: {
data: {
connectionInfo: { // db connection info, as defined in simple-knex
user: 'user',
password: 'password',
database: 'db name',
host: 'ip'
},
client: 'mysql'
}
}
sourceFolder: './src' // specify files live in ./src
})
bot.connect()
// src/commands/echo.js
const { Command } = require('eris-boiler')
// commands must export a function bringing bot into the constructor
module.exports = (bot) => new Command(
bot,
{
name: 'echo', // name of command
description: 'copy that',
run: async ({ params }) => params.join(' ') // functionality of command
// list of things in object passed to run: bot (DataClient), msg (Message), params (String[])
}
)
// src/events/presenceUpdate.js
// event files should be named by event name
const { Event } = require('eris-boiler')
module.exports = new Event({
name: 'presenceUpdate', // name should match event name
run: (bot, newMember, oldMember) => bot.logger.warn('something changed')
// bot is bound to all events, so bot will be the first parameter in addition to any parameters passed in from Eris
})
That should cover most things anyone starting out should need to know.
Before starting work you should hash it out with us over on discord to make sure it is not already being worked on by someone else.
Check out our guidelines here.
- Clone this repository
- Run
npm install
- Add your token and other options
- Run
npm run dev