Releases: alex-taxiera/eris-boiler
v3.0.0
v3.0.0-beta.11
Alright guys, it's almost done
v3.0.0-beta.10
I swear v3 is almost done now.
v3.0.0-beta.5
Sorry I'm pretty sure this fucks everything up.
Pretty sure setting up a database for SQLManager is completely on you now, going to have to add that back in, probably with a migration file. That being said, we have a cute little custom ORM now, i'll be testing it out.
v3.0.0-beta.2
Beta Update
Almost ready for an official release :)
Installation
npm i alex-taxiera/eris-boiler#05e0ac3
Fixes
- Combining default and new DB schemas.
- Case sensitive file requiring (sorry Linux).
- Selecting strings from DB, numbers stored as strings were garbled and parsed into numbers, now they come back as strings.
- Load toggles into the toggle map instead of settings.
v3 Beta
v3 is NEAR
Get ready.
NPM
Major work has been done to rework this as an NPM package, documentation and examples are to come once this gets finalized
How To
Installation
npm i alex-taxiera/eris-boiler#83668ed
Usage
NOTE: This has only been tested with MySQL/MariaDB, but should also work with PostgreSQL
// index.js
require('dotenv').load() // load .env
const { DataClient } = require('eris-boiler')
const bot = new DataClient({sourceFolder: './src'}) // specify files live in ./src
bot.connect()
// .env
TOKEN=XXX
DB_NAME=my-bot
DB_USER=user
DB_PASS=pass
// 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.
Release 2.0.0
Everything is much stronger and more robust.
Commands have more options and the DatabaseManager is more fleshed out.
Release 1.0.0
this is garbo, 2.0.0 coming soon