diff --git a/scripts/conduct.coffee b/scripts/conduct.coffee deleted file mode 100644 index 88938cb..0000000 --- a/scripts/conduct.coffee +++ /dev/null @@ -1,20 +0,0 @@ -# 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/i, (msg) -> - msg.send "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" - msg.send "Generally let's keep things PG." diff --git a/scripts/conduct.js b/scripts/conduct.js new file mode 100644 index 0000000..d3fbb89 --- /dev/null +++ b/scripts/conduct.js @@ -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]) + } + } + }) +}