Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikemimik/mumblebot
mumble bot
https://github.com/mikemimik/mumblebot
Last synced: 8 days ago
JSON representation
mumble bot
- Host: GitHub
- URL: https://github.com/mikemimik/mumblebot
- Owner: mikemimik
- License: gpl-2.0
- Created: 2016-01-05T08:02:32.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-26T08:34:56.000Z (almost 9 years ago)
- Last Synced: 2024-10-31T03:42:18.427Z (about 2 months ago)
- Language: JavaScript
- Size: 64.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## EMITTED EVENTS
### Default Event Format
```javascript
@param {String} event-id
@param {CollinsError|Error} error
@param {Collins} contextcollins.on('event-id', (error, context) => {
});
```### Emitted Errors
```javascript
'use strict';
const Collins = require('collins');
const config = require('./config');collins.on('error', (error, context) => {
/**
* @event error
* @param {CollinsError} error
* @param {Collins} context
*/
});
collins.init();
```## PLUGINS
```javascript
/* created plugin */
/* file exists inside the ./plugins directory *//**
* @notes
* - Triggers must start with a letter
* - Triggers must be one word
*/
// collins-plugin-name.js
'use strict';
module.exports = {
name: 'collins-plugin-name', /* plugin name */
triggers: {
'firstTrigger': function(context) {
console.log('>> firstTrigger >>');
},
'syncTrigger': function(context, done) {
console.log('this trigger is synchronous');
done(null);
},
'asyncTrigger': function(context, done) {
setTimeout(() => {
done(null);
}
}
}
};// app.js
const Collins = require('collins');
const config = require('./config');const myPlugin = require('./plugins/collins-plugin-name');
let collins = new Collins(config);
collins.use(myPlugin);
```
```javascript
/* config file */
/* add plugin into config file */// config.js
'use strict';
module.exports = {
server: 'mumble-uri',
username: 'collins',
password: 'mumble-password',
plugins: ['collins-plugin-name'],
ssl: {
key: 'path-to-key.pem',
cert: 'path-to-cert.pem'
},
debug: false
};// app.js
const Collins = require('collins');
const config = require('./config');let collins = new Collins(config);
collins.init();
```