I want a make a command that keeps a record of the number of days where the viewer is actually PRESENT in my channel (NOT !followage)
I figure one way to do that is to make a command that user can use only once per day
For example, if the user types !present for the first time, nightbot will response: "{trouser} is present for 1 day"
if the user types the same command before a 12am, it will either not response or give the same response as above
if the user types the command the next day nightbot will response: "{trouser} is present for 2 days" , etc.
Is there anyway I can do this?
5 replies
Hushed Sloth
Also, if its possible I also want to: 1) I want the command to only work while I am streaming 2) I want the reset time to be 12am KST (Korean Standard Timezone) because I am streaming in a Korean server and most of my viewers are Korean
Gerhard
Hiya, this whole setup is very specific, I dont think there is a build-in way to accomplish this. However with $(urlfetch) or $(eval) you can create externsal scripts that could handle this.
Hushed Sloth
what url should I use for the $(urlfetch) variable?
and unfortunately I don't know javasciprt enough to use $(eval) but thanks for your response
Polar Cat
Hey @Hushed Sloth!
I'm not sure it'll work and I don't have time to test it, so please keep me updated if it works.
We'll use the quote system API. You'll get your TOKENS by clicking on the second link in the post, in the Manual Installation section, use these in the commands I wrote. To know where to look for your PUBLIC_TOKEN and PRIVATE_TOKEN, look at the field bellow:
Keep your PRIVATE_TOKEN secret, don’t share it anywhere. Add the following commands from the dashboard. Don’t use the chat as anyone could monitor it and copy the token, they could then edit your data.
Now for the commands, I'm not sure it'll work, but it's worth the try:
• _present: alias of !present, type _present in the alias field of !present.
Polar Cat
$(eval a=$(urlfetch https://twitch.center/customapi$(query));q=`$(query)`.split(`|`);q.length>1?`$(user) has been present for ${q[q.length-2]}`:q==`o`?`You can't use this command now, $(user).`:q==`r`?`You already used the command today, $(user).`:`ERROR`;)
Possible point of failure: the quote API might not add quotes, which would result in the whole thing not working, I recommend testing the command and having a look and see if it added the quotes at: https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN
Didn't find your answer? The community is on Discord.