Trying to fetch a follower amount and then do math with it

Hi There! Recently a streamer I mod for got botted by almost 140,000 followers which sucks. A few people have suggested she use that third party tool for forcibly removing them herself, but she already reported it to twitch and just wants to wait until they handle it themselves. But in the mean time she’s fairly new and has set up a bunch of follower goals previously which are kind of ruined now because anyone that uses !followers it just shows up as “so and so has 140k followers”

So I was just wondering if there’s any way to use the $(twitch night “{{displayName}} has {{followers}} followers”) command but then to subtract 139,000 from it and display the new total? Thank you!

$(eval X=$(twitch $(channel) "{{followers}}");F=X-139000;`$(channel) has ${F} followers`)

Hey thanks for the reply! But when I put that in, it keeps coming out as streamer has -138858 followers

Sounds like the followers have updated and aren’t up so high anymore.

on her page, and when you call the !followers command, they both come up with 142,298 followers. So technically the math should be right? It should be at 3,298 but for some reason that I can’t figure out, your line of code keeps coming out as “soandso has 139458 followers”. Like your line makes sense, but I don’t know why it keeps coming out with this weird number

I keep trying to change the order of some of the math, or switching some stuff around but nothing is working :sweat_smile: Thanks again for your help

Could you possibly tell me the channel name I can check it out and see if I can figure it out for you.

The problem was that it returns the number with a “,” here’s a new command to get around that:

$(eval X=`$(twitch $(channel) "{{followers}}")`.replace(`,`,``);F=parseInt(X)-139000;`@$(channel) has ${F.toString().slice(0,F.toString().length-3)},${F.toString().slice(1)} followers!!!`)

Sorry for the inconvenience.

1 Like

oh I understand now! I never would have thought of that comma hahaha thank you so much for your help and for the quick answer :grin:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.