You tired of how your viewers asking you HOW LONG in your chat? WELL WE GOT YOU COVERED!
This was out of personal need and Teak from TeakSoftware.com and our own NightDev extraordinaire stepped forward to help me out. So I thought I would share with the community on how to add it to their own chat and allow users to check how long they have been following for.
Now Teak went through the code/command and had it pretty much setup for allowing allow of ways for streamers and users to use said code to allow people to check when they 1st followed a channel they are in.
NOTE: The command has to be setup by the streamers with Nightbot to work. This is not a global feature.
The bases of the code is to allow a user to type !howlong in the streamers chat and it will in return give the date the followed. There is a basic cool down time for the command but if you feel like the command would be spammed, Teak has also set it up to allow !howlong USERNAME so you can have it set to MOD only command.
So let’s get right into it.
The basic code is
!addcom !howlong $(touser) Has Been Following USERNAME On Twitch Since $(customapi http://api.newtimenow.com/follow-length/?channel=USERNAME&user=$(touser))
NOTE: Make sure to change USERNAME to your Twitch USERNAME
Then all a user has to do is type !howlong in chat and Nightbot will return.
Now if you want to set it to REG or MOD, all you would need to do is add a userlevel variable.
!addcom -ul=mod !howlong $(touser) Has Been Following USERNAME On Twitch Since $(customapi http://api.newtimenow.com/follow-length/?channel=USERNAME&user=$(touser))
NOTE: Make sure to change USERNAME to your Twitch USERNAME
Then a REG user can use the basic !howlong command or a MOD can do !howlong USERNAME
I’m replying as a user but do you know if this new command you shared allows to use have it so you can search a users name or for them to put it in. I am awful at explaining things.
EXAMPLE
!howlong (this would give “VaughnWhiskey has followed for AMOUNT”)
!howlong USERNAME (Would give “USERNAME has followed for AMOUNT”)
just wondering because the one Teak setup will allow both within the one command.
!addcom -ul=mod !howlong $(touser) Has Been Following USERNAME On Twitch Since $(customapi http://api.newtimenow.com/follow-length/?channel=USERNAME&user=$(touser))
Change USERNAME your Twitch channel name in both places.
!addcom -ul=mod !howlong $(touser) Has Been Following USERNAME on Twitch for: $(customapi https://apis.rtainc.co/twitchbot/following?channel=USERNAME&user=$(touser)).
It doesnt seem to work anymore for myself, i just get this error message:
Nightbot:
raydah Has Been Following Raydah on Twitch for: Warning: file_get_contents(https://api.twitch.tv/kraken/users/raydah/follows/channels/raydah): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Foundin /home/rtainc/www/apis.rtainc.co/twitchbot/following.php on line 5 raydah is not following.
Here is an example that you could probably use. !commands add !followlength $(touser) has been following $(channel) since: $(customapi http://api.newtimenow.com/follow-length/?channel=$(channel)&user=$(touser))
Ive tried using this command for my friends stream, and it just says ‘‘not following…’’ may i please have help on this. The command used to work until the new update on Nightbot, after that it stopped working.
Thank you in advance