                 return
 
             if not object.stream
-                msg.reply "The stream you have entered (\"#{msg.match[1]}\") is currently offline."
+                msg.reply "The stream you have entered (\"#{msg.match[1]}\") is currently offline. Try again later."
                 return
 
             channel = object.stream.channel
             msg.send "#{channel.display_name} is streaming #{channel.game} @ #{channel.url}"
             msg.send "Stream status: \"#{channel.status}\""
             msg.send "Viewers: #{object.stream.viewers}"
+
+    robot.respond /ttv top/i, (msg) ->
+        createURL = (game) ->
+            "http://www.twitch.tv/directory/game/#{encodeURIComponent(game)}"
+
+        twitch_request msg, "/games/top", limit: 5, (object) ->
+            for gameObj, i in object.top
+                msg.send "#{i + 1}. #{gameObj.game.name} | Viewers: #{gameObj.viewers} | Channels: #{gameObj.channels} | #{createURL(gameObj.game.name)}"
 
 twitch_request = (msg, api, params = {}, handler) ->
     msg.http("https://api.twitch.tv/kraken#{api}")

#   None
#
# Commands:
#   hubot ttv game <category> - Returns the first 5 live streams in a game <category> (case-sensitive)
#   hubot ttv featured - Returns the first 5 featured live streams
#   hubot ttv stream <name> - Returns information about stream <name>
#   hubot ttv search <query> - Returns a list of live streams matching the search <query>
#
# Author:
#   MrSaints

                channel = stream.channel
                msg.send "#{channel.display_name} (\"#{channel.status}\") - #{channel.url} [Viewers: #{stream.viewers}]"

            if object._total > maxResults
                msg.reply "There are #{object._total - maxResults} other \"#{category}\" live streams."

    robot.respond /ttv search (.*)/i, (msg) ->
        query = msg.match[1]
        twitch_request msg, "/search/streams", { q: query, limit: maxResults }, (object) ->
            if object._total is 0
                msg.reply "No live streams were found using search query: \"#{query}\". Try a different query or try again later."
                return

            for stream in object.streams
                channel = stream.channel
                msg.send "#{channel.display_name} (\"#{channel.status}\") - #{channel.url} [Viewers: #{stream.viewers}]"

            if object._total > maxResults
                msg.reply "There are #{object._total - maxResults} other live streams matching your search query: \"#{query}\"."

    robot.respond /ttv stream (.*)/i, (msg) ->
        twitch_request msg, "/streams/#{msg.match[1]}", null, (object) ->
