Hello, I have a command that allows viewers to ban each other for fun with !ban and have !unban as well.
I want the !ban command to count how many times a certain user have been banned and not just how many times someone has been banned. Furthermore, I want the !unban to remove 1 count from the certain user.
E.g.
user1: !ban user2
nightbot: user2 has been banned 2 time(s)
user1: !unban user2
and either this:
nighbot: user2 has been unbanned but is still banned 1 time(s)
or this:
nightbot: user2 has been unbanned
(and next time someone bans user2 again, nightbot would say user2 has been banned 2 time(s) again.
@bascounter Welcome to the community. Sorry, the feature you want is not possible by the Nightbot, as Nightbot do NOT store any single user’s information.
Actually it is possible try this:
First generation two tokens here https://twitch.center/customapi/quote/generate
They come inbetween token= and &data.
The 16 digit token is your private one and the 8 digit one if your public one.
$(eval A=`$(1)`;B=$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1).split(`,`);C=B[B.length-1].split(` `);A==`Successfully`?`@${C[0]} has been banned ${C[1]} times.`:`Please put a name after the command`)
$(eval A=`$(1)`;B=$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1).split(`,`);C=B[B.length-1].split(` `);A==`Successfully`?`@${C[0]} has been unbanned user has ${C[1]} bans left.`:`Please put a name after the command or make sure user has been banned before.`)
Make sure to replace the tokens.
Now I can’t promise this will work I just wrote it out and didn’t test it if it doesn’t work let me know and I can fix it for you later.