I'm currently trying to integrate my website's API with my discord BOT and got stuck on a small issue I can't find solution for.
Basically, my API returns some social media connections like steam or twitch. All working fine until the user doesn't connect their socials, so the API provides "null" cause there's no connection.
I've tried to do "If twitch is null then don't addFiled", but bot either doesn't care or throws "cannot read content of "null" when I tried twitch.content == 'null'.
let twitchName = body.data.socials.twitch
if (twitchName == 'null') {
return
} else {
driverembed.addField('Twitch.tv', `[${body.data.socials.twitch}](https://www.twitch.tv/${body.data.socials.twitch})`)
}
So, even if the twitch comes back as "null", the bot adds the field to the embed.
I'd greatly appriciate any help possible! Thank you.