Skip to content

Commit

Permalink
Create a sneakyboy-requests script
Browse files Browse the repository at this point in the history
Why:

To allow members of sneakyhead to be able to make shoe requests to
sneakybot in slack.

[√] app.json 📄
[√] hubot-scripts.json 📝
[√] scripts/example.coffee 📝
[√] scripts/sneakybot-requests.coffee 📄

This change addresses the need by:

[*] https://trello.com/c/fvNTqfTW/1-storing-data
  • Loading branch information
mrbernnz committed Feb 12, 2016
1 parent afa01e2 commit 011ae67
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
2 changes: 0 additions & 2 deletions scripts/example.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#
# These are from the scripting documentation: https://github.com/github/hubot/blob/master/docs/scripting.md
#
# Commands:
# sneakybot request - Make a sneaker request.

module.exports = (robot) ->

Expand Down
36 changes: 36 additions & 0 deletions scripts/sneakybot-requests.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Description:
# A request system for slack.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# request - Make a sneaker request.
# who is - Return who is the user.
#
# Notes:
#
# Author:
# mrbernnz

module.exports = (robot) ->

robot.respond /request (.*) (.*)$/i, (msg) ->
shoeRequest = msg.match[1]
shoeSize = msg.match[2]

robot.brain.set 'totalShoeRequests', shoeRequest
msg.reply "We received your request for #{shoeRequest}"

robot.respond /who is @?([\w .\-]+)\?*$/i, (res) ->
name = res.match[1].trim()

users = robot.brain.usersForFuzzyName(name)
if users.length is 1
user = users[0]
# Do something interesting here..

res.send "#{name} is user - #{user}"
34 changes: 0 additions & 34 deletions scripts/welcome.coffee

This file was deleted.

0 comments on commit 011ae67

Please sign in to comment.