 hear = (pattern, callback) ->
   handlers.push [ pattern, callback ]
 
+descriptions = {}
+desc = (phrase, functionality) ->
+  descriptions[phrase] = functionality
+
 
 #
 # robot heart

  message.say "I am learning to love."

hear /help/, (message) ->
  message.say "I listen for '@#{username} image me PHRASE' and '@#{username} wiki me PHRASE' and '@#{username} weather in PLACE'"

hear /weather in (.+)/i, (message) ->
  place = message.match[1]
  url   = "http://www.google.com/ig/api?weather=#{escape place}"

    catch e
      console.log "Weather error: " + e

desc 'wiki me PHRASE', 'returns a wikipedia page for PHRASE'
hear /wiki me (.*)/i, (message) ->
  term = escape(message.match[1])
  url  = "http://en.wikipedia.org/w/api.php?action=opensearch&search=#{term}&format=json"
