From bdbeeefa2cd63f4903a77334456a3cbdf13f4d73 Mon Sep 17 00:00:00 2001 From: Aaron Date: Sat, 29 Oct 2016 22:23:52 -0500 Subject: [PATCH 1/2] conduct can respond in dm --- scripts/conduct.coffee | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/conduct.coffee b/scripts/conduct.coffee index 88938cb..7f4c719 100644 --- a/scripts/conduct.coffee +++ b/scripts/conduct.coffee @@ -9,12 +9,22 @@ # # Commands: # hubot conduct - Remind the channel about the devICT code of conduct +# hubot remind of COC - Sends a DM to user with 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 " + + 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." + "https://devict.org/conduct") + msg.send("Generally let's keep things PG.") + + robot.respond /remind (.*) of COC/i, (msg) -> + reason = msg.match[1] + msg.send("/dm #{reason} 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("/dm #{reason} Generally let's keep things PG.") \ No newline at end of file From 4af305a56aab37cfb937b11e63d460d125de1eea Mon Sep 17 00:00:00 2001 From: Aaron Date: Mon, 31 Oct 2016 21:55:54 -0500 Subject: [PATCH 2/2] conduct sends to user or channel per issue #35 --- scripts/conduct.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/conduct.coffee b/scripts/conduct.coffee index 7f4c719..47e8c47 100644 --- a/scripts/conduct.coffee +++ b/scripts/conduct.coffee @@ -10,6 +10,7 @@ # Commands: # hubot conduct - Remind the channel about the devICT code of conduct # hubot remind of COC - Sends a DM to user with code of conduct +# hubot remind of COC - Remind about the devICT code of conduct module.exports = (robot) -> robot.respond /(code( of)? )?conduct/i, (msg) -> @@ -21,10 +22,10 @@ module.exports = (robot) -> msg.send("Generally let's keep things PG.") robot.respond /remind (.*) of COC/i, (msg) -> - reason = msg.match[1] - msg.send("/dm #{reason} devICT is dedicated to a safe and harassment-free experience for " + + uname = msg.match[1] + robot.send({ room: uname }, "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("/dm #{reason} Generally let's keep things PG.") \ No newline at end of file + robot.send({ room: uname }, "Generally let's keep things PG.") \ No newline at end of file