     4: "Co-op with bots"
     5: "Team match"
     6: "Solo queue"
+    7: "N/A"
 towers = [
     "Ancient top"
     "Ancient bottom"

# Commands:
#   hubot steam id [me] <custom URL> - Returns the Steam ID for the user under http://steamcommunity.com/id/<custom URL>
#   hubot steam status <Steam ID> - Returns <Steam ID> community status
#   hubot dota history <Steam ID> - Returns metadata for the latest 5 game lobbies with <Steam ID>
#   hubot dota match <match ID> [<Steam ID>] - Returns information about a particular <match ID>. Optionally, if <Steam ID> is included, its match information will also be returned
#
# Author:

            msg.reply "#{msg.match[1]} belongs to #{player.personaname} who is currently #{status} and was last online #{lastOnline}."
        , 2

    robot.respond /dota history (-u )?(.*)/i, (msg) ->
        [command, flag, value] = msg.match

        params =
            account_id: value
            matches_requested: 5

        history = (params, type = 'Steam ID') ->
            steam_request msg, "/IDOTA2Match_570/GetMatchHistory", params, (object) ->
                if object.result.status is 15
                    msg.reply "The #{type} you have entered (\"#{msg.match[1]}\") does not exist or it does not have match history enabled."
                    return
                else if object.result.num_results is 0
                    msg.reply "No game matches were found for the #{type}: #{msg.match[1]}."
                    return

                communityID = getCommunityID params.account_id

                for match in object.result.matches
                    hero = "N/A"
                    start = moment.unix(match.start_time).fromNow()

                    for player in match.players
                        if player.account_id is communityID
                            hero = getHero(player.hero_id).localized_name
                            break;

                    msg.send "Match ID: #{match.match_id} | Lobby: #{lobbies[match.lobby_type]} | Hero: #{hero} | #{start}"

        if flag is '-u '
            getSteamID msg, value, (id) ->
                return false if not id
                params.account_id = id
                history params, 'profile URL'
        else
            history params

    robot.respond /dota match (\d+)( \d*)?/i, (msg) ->
        steam_request msg, "/IDOTA2Match_570/GetMatchDetails", match_id: msg.match[1], (object) ->
