Skip to content

Instantly share code, notes, and snippets.

@atmos
Created October 25, 2011 02:48
Show Gist options
  • Save atmos/1311167 to your computer and use it in GitHub Desktop.
Save atmos/1311167 to your computer and use it in GitHub Desktop.
storage.coffee
# 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