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

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

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

    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 (\"#{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}: #{params.original}."
                    return

                communityID = getCommunityID params.account_id
