             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
+    robot.respond /dota history (.*)/i, (msg) ->
+        [command, value] = msg.match
 
         params =
+            original: value
             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."
+                    msg.reply "The #{type} you have entered (\"#{params.original}\") 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]}."
+                    msg.reply "No game matches were found for the #{type}: #{params.original}."
                     return
 
                 communityID = getCommunityID params.account_id


                    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
            if typeof value isnt 'number'
                msg.reply "Invalid Steam ID entered. Please ensure you have included the -u flag if you are trying to search by profile URL."
                return
            history params

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

#   MrSaints

moment = require 'moment'
require 'ref'

personaStates = [
    "Offline"
