I'm using the Steam Developer API to create a Discord Bot. I'm using the ResolveVanityURL call of ISteamUser, and it is calling correctly. However, when I try to use it within my code, it always states "response is not defined". The output from the call is very simple and is as follows:
My snippet of code is as follows:
let { vanityURL } = superagent
.get(`http://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/?key=${stApiKey}&vanityurl=${args[0]}`);
console.log(vanityURL.response.steamid)
Essentially, I'm calling the API using arguments from my Discord bot to fetch the Steam ID from the Vanity URL. It calls without errors, but when I try console.log it as seen above, it gives me this error: (node:14580) UnhandledPromiseRejectionWarning: ReferenceError: response is not defined
.
How can I make it so this error doesn't continue? Thanks.