If follower after certain time

Asked Mar 14, 2020·1 reply·Last activity 6 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

hi, i was coding for a friend and was hoping for some help. I want to make a command that only 6 month+ followers can use. i coded this but it did not work. please help. thanks!

if(follow < 15778463){
You have not followed long enough to use this command
}
else(){
$(user) has said to spam GG in the chat!
}

1 reply

Hey @Peachy Rabbit!

In your command you want to get the amount of months the user has been following the channel first. Which you can do with the following API:

https://api.2g.be/twitch/followage/$(channel)/$(touser)?format=months

So your command would look like this:

$(eval var m=`$(urlfetch https://api.2g.be/twitch/followage/$(channel)/$(user)?format=months)`.split(` `); m=m[m.length-2]; if(m<6||isNaN(m)){`You have not followed long enough to use this command.`}else{`$(user) has said to spam GG in the chat!`})