Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Commit

Permalink
accept a channel for bot conduct
Browse files Browse the repository at this point in the history
  • Loading branch information
blunket committed May 21, 2018
1 parent e1ab0f6 commit d269bc4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 20 deletions.
20 changes: 0 additions & 20 deletions scripts/conduct.coffee

This file was deleted.

33 changes: 33 additions & 0 deletions scripts/conduct.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Description:
// Remind members about our code of conduct
//
// Dependencies:
// None
//
// Configuration:
// None
//
// Commands:
// hubot conduct - Remind the channel about the devICT code of conduct

module.exports = (robot) => {
robot.respond(/(?:code(?: of)? )?conduct(?:\s?([#@][\w-]+))?/i, (msg) => {
let msgs = [
"devICT is dedicated to a safe and harassment-free experience for " +
"everyone. We do not tolerate harassment in any form. If you have any " +
"questions or concerns please feel free to reach out to one of the devICT " +
"organizers. Our anti-harassment policy can be found at: " +
"https://devict.org/conduct",
"Generally let's keep things PG."
]
if (typeof msg.match[1] !== 'undefined') { // a channel was specified
for (let i = 0; i < msgs.length; i++) {
robot.messageRoom(msg.match[1], msgs[i])
}
} else {
for (let i = 0; i < msgs.length; i++) {
msg.send(msgs[i])
}
}
})
}

0 comments on commit d269bc4

Please sign in to comment.