Created
October 25, 2011 02:48
-
-
Save atmos/1311167 to your computer and use it in GitHub Desktop.
storage.coffee
This file contains hidden or 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
# Inspect the data in redis easily | |
# | |
# show users - Display all users that hubot knows about | |
# show storage - Display the contents that are persisted in redis | |
# | |
Sys = require "sys" | |
module.exports = (robot) -> | |
robot.respond /show storage$/i, (msg) -> | |
output = Sys.inspect(robot.brain.data, false, 4) | |
msg.send output | |
robot.respond /show users$/i, (msg) -> | |
response = "" | |
for own key, user of robot.brain.data.users | |
response += "#{user.id} #{user.name}" | |
response += " <#{user.email_address}>" if user.email_address | |
response += "\n" | |
msg.send response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment