-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
3 changed files
with
36 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" |
This file was deleted.
Oops, something went wrong.