Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rosscomputerguy/slimcord.js
A simple Discord Bot framework. Used for HaroBot and Lordgenome Discord Bots.
https://github.com/rosscomputerguy/slimcord.js
discord discord-bot discord-framework discord-js
Last synced: 13 days ago
JSON representation
A simple Discord Bot framework. Used for HaroBot and Lordgenome Discord Bots.
- Host: GitHub
- URL: https://github.com/rosscomputerguy/slimcord.js
- Owner: RossComputerGuy
- License: gpl-3.0
- Created: 2019-02-11T03:34:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-18T15:47:06.000Z (almost 6 years ago)
- Last Synced: 2024-11-18T10:16:23.479Z (2 months ago)
- Topics: discord, discord-bot, discord-framework, discord-js
- Language: JavaScript
- Homepage:
- Size: 75.2 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# slimcord.js
A simple Discord Bot framework. Used for HaroBot and Lordgenome Discord Bots.
## Example
This will **only** start the bot with no modules.
```js
const {Core} = require('slimcord.js');let bot = new Core({});
bot.boot().catch(err => {
console.error(err);
process.exit(1);
});
```## Example Module
```js
class MyModule {
constructor(core, options) {
this.core = core;
this.options = options;
}
metadata() {
return {
name: 'My Module',
desc: 'Hello, world.',
author: 'Me',
ver: '0.1.0',
url: 'https://example.com',
provides: [
'mymodule/mything'
]
};
}
async init() {
this.core.instance('mymodule/mything', (opts) => Object.assign({val: 'Hello, world'}, opts));
}
start() {
this.core.registerCommand('hello', {
description: 'Hello, world',
usage: 'hello',
run: (args, message, channel) => channel.send('Hello, world!')
});
}
destroy() {
delete this.core.commands['hello'];
}
}
```### Adding the example module
Before your `bot.boot()` line, add this:
```js
bot.register(MyModule);
```