I cant get follower goal to work

!editcom !goal $(channel) is $(urlfetch http://twitch.center/customapi/math?expr=3000-$(twitch$(channel)“{{followers}}”)) followers away from reaching the goal!

this displays ??? everytime and

!editcom !goal TYGALAXY is $(eval 3000-$(twitch $(channel) “{{followers}}”)) followers away from reaching the goal!

displays the wrong number, usually 19 for some reason

its not for me its for a channel that im mod for.

Your command:

!editcom !goal TYGALAXY is $(eval 3000-$(twitch $(channel) "{{followers}}")) followers away from reaching the goal!

displays 19 because $(twitch $(channel) "{{followers}}") is replaced by 2,019. This means that 3000-2,019 is being evaluated. This expression contains the comma operator, which evaluates each of its operands and returns the value of the last operand. This means that 3000-2 and 019 are being separately evaluated, and 19 is being returned.

Try this command:

!editcom !goal $(eval followersString = `$(twitch $(channel) "{{followers}}")`; followers = parseInt(followersString.replace(/,/g, "")); followers ? `TYGALAXY is ${(3000 - followers).toLocaleString()} followers away from reaching the goal!` : followersString)

That worked, thank you.

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