-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple Start, Service-oriented Refactor #9
Conversation
lib/doorChat.js
Outdated
Doorman.setupCommands(); | ||
|
||
// Discord | ||
require('./discord/discordSupport')(Doorman); | ||
//require('./discord/discordSupport')(Doorman); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've disabled Discord for now as I don't have the ability to test.
const Maki = require('maki'); | ||
const makiConfig = require('../config/makiConfig'); | ||
const config = require('../config/maki'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm removing prefixes as they are redundant.
lib/slack/onEvent/message.js
Outdated
@@ -193,5 +199,5 @@ module.exports = function (Doorman) { | |||
} | |||
} | |||
|
|||
Doorman.Slack.on(Doorman.Slack.rtm_events.MESSAGE, msg => checkMessageForCommand(msg, false)); | |||
Doorman.Slack.on('message', msg => checkMessageForCommand(msg, false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new Slack SDK has changed the location of these helpers, and I feel it would be better to know exactly what message type is being handled — no need to configure these anyway, so it is better to be explicit.
package.json
Outdated
@@ -4,6 +4,7 @@ | |||
"description": "simple community management", | |||
"main": "doorman.js", | |||
"scripts": { | |||
"start": "node doorman.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching to using npm start
as the recommended command for launching the bot. Will also add section to README on running as a service (probably using pm2
).
test/doorman.unit.js
Outdated
@@ -7,4 +7,13 @@ describe('Doorman', function () { | |||
it('should expose a constructor', function () { | |||
assert(typeof Doorman, 'function'); | |||
}); | |||
|
|||
it('can handle a message', function (done) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stub test to mock up the desired API for 0.2.0
.
This is mostly finished, but I'd like to add tests and get some reasonable coverage before merging. I'll keep the Happy to accept comments before then! |
Simple start
added basic discord support
This begins a refactor aimed at making the installation of Doorman as simple as possible.