Permalink
Browse files

Hubot, be polite and say hello

  • Loading branch information...
1 parent 3dd2d4a commit 5748f3381df001187667e8b3fce977adcd8eaa8a @marioBonales marioBonales committed Jan 18, 2013
Showing with 33 additions and 0 deletions.
  1. +33 −0 src/scripts/hello.coffee
View
@@ -0,0 +1,33 @@
+# Description:
+# Hubot, be polite and say hello.
+#
+# Dependencies:
+# None
+#
+# Configuration:
+# None
+#
+# Commands:
+# Hello or Good Day make hubot say hello to you back
+# Good Morning makes hubot say good morning to you back
+hellos = [
+ "Well hello there, %",
+ "Hey %, Hello!",
+ "Marnin', %",
+ "Good day, %",
+ "Good 'aye!, %"
+]
+mornings = [
+ "Good morning, %",
+ "Good morning to you too, %",
+ "Good day, %",
+ "Good 'aye!, %"
+]
+module.exports = (robot) ->
+ robot.hear /(hello|good( [d'])?ay(e)?)/i, (msg) ->
+ hello = msg.random hellos
+ msg.send hello.replace "%", msg.message.user.name
+
+ robot.hear /(^(good )?m(a|o)rnin(g)?)/i, (msg) ->
+ hello = msg.random mornings
+ msg.send hello.replace "%", msg.message.user.name

0 comments on commit 5748f33

Please sign in to comment.