...
 
Commits (3)
{
"name": "fxabot",
"version": "0.2.4",
"version": "0.2.5",
"private": true,
"description": "Downtrodden dogsbody for the Firefox Accounts team.",
"keywords": [
......
......@@ -12,9 +12,13 @@
'use strict'
const assert = require('assert')
const check = require('check-types')
const DEVS = [ 'pb', 'stomlinson', 'vbudhram', 'dcoates', 'ianbicking', 'lorchard' ]
const IRC_DEVS = [ 'pb', 'stomlinson', 'vbudhram', 'dcoates', 'ianbicking', 'lorchard' ]
const SLACK_DEVS = [ '@pbooth', '@stomlinson', '@vbudhram', '@dcoates', '@Ian', '@lorchard' ]
assert.equal(IRC_DEVS.length, SLACK_DEVS.length)
module.exports = robot => {
robot.respond(/nominate(?:\s+dev(?:eloper)?)?\s*$/i, response => {
......@@ -26,8 +30,9 @@ module.exports = robot => {
lastDev = -1
}
const nextDev = (lastDev + 1) % DEVS.length
const nextDev = (lastDev + 1) % IRC_DEVS.length
robot.brain.set('dev', nextDev)
response.send(`I nominate ${DEVS[nextDev]}`)
const devs = robot.adapterName === 'irc' ? IRC_DEVS : SLACK_DEVS
response.send(`I nominate ${devs[nextDev]}`)
})
}
......@@ -65,7 +65,8 @@ module.exports = robot => {
const { action, number, pull_request: pr } = event.payload
if (event.type === 'PullRequestEvent' && ACTIONS.has(action) && ! prs.has(number)) {
prs.add(number)
robot.messageRoom('fxa', `PR #${number}: ${action}\n${pr.html_url}`)
const room = robot.adapterName === 'irc' ? '#fxa' : 'fxa'
robot.messageRoom(room, `PR #${number}: ${action}\n${pr.html_url}`)
}
})
} else {
......