 
                     msg.send "Match ID: #{match.match_id} | Lobby: #{lobbies[match.lobby_type]} | Hero: #{hero} | #{start}"
 
-        if flag is '-u '
+        if value.match /\d{17}/
+            history params
+        else
             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) ->

getSteamID = (msg, customURL, handler) ->
    steam_request msg, "/ISteamUser/ResolveVanityURL", vanityurl: customURL, (object) ->
        if object.response.success is 42
            msg.reply "The custom URL you have entered (\"#{msg.match[2]}\") does not exist."
            return

        handler object.response.steamid

getCommunityID = (steamID) ->
    # 64 -> 32
    (steamID - 76561197960265728)

getHero = (heroID) ->
    return hero for hero in heroes when hero.id is heroID

module.exports = (robot) ->
    robot.respond /steam id( me)? (.*)/i, (msg) ->
        getSteamID msg, msg.match[2], (id) ->
            msg.match[2] += if msg.match[2].slice(-1) is "s" then "'" else "'s"
            msg.reply "#{msg.match[2]} Steam ID is: #{id}"

    robot.respond /steam status (\d+)/i, (msg) ->
        steam_request msg, "/ISteamUser/GetPlayerSummaries", steamids: msg.match[1], (object) ->
