!ban command - more interactive

Hi guys!
So I’m trying to make a more funny !ban command on my chat.

Right now I have a very simple one:
$(touser) was banned!
When someone types !ban Ana, the bot just replies “Ana was banned!”

But I was thinking of a more interactive one… A command that would say something like “you cannot ban John154” if the $(touser) is John154 and would know if you say your own name/user.

It’s just a funny command that would have 3 different answers (I guess).

If you say your name the answer would be "you just banned yourself!"
if you say John154’s name (a moderator of my chat on Twitch) the bot would say that “you cannot ban John154!” and if it’s any other user the message would be “user was banned!” (like the simple one I have now).

I found a similar command… That I tought I could edit and maybe could work, but I couldn’t edit enough to work the way I wanted. It was something like:

!hug … {Wow! ${u} hugged himself.;}else if(a.toLowerCase()==nightbot)…{@${u} Thanks for hugging me!;}else if(!a){Wow! ${u} hugged everyone!;}else{Wow! ${u} hugged ${a}!;}))

If anyone could help me, I would appreciate.
Thank you!

Try this:

!editcom !ban $(eval a=[`Mod1`,`Mod2`,`Mod3`];b=[`$(user)`];`$(user)`==`$(touser)`?`You can’t ban yourself!`:a.some(item=>b.includes(item))?`You can’t ban @$(touser)!!!`:`You banned $(touser)!`)

The first array “a” you can put as many or as few names as you want they are the people immune to getting “banned” just make sure all the names are typed in lowercase.

First of all, thank you for your time and help!

I tried editing with just one name and ended with something like this

$(eval a=[`athena`];b=[`$(user)`];`$(user)`==`$(touser)`?`You can’t ban yourself!`:a.some(item=>b.includes(item))?`You can’t ban $(touser)!!!`:`You banned $(touser)!`)

But for some reason it does not recognize athena or the “you can’t ban yourself”… whatever we write after the command, he replies the “you banned xxx”.

:pensive: :thinking:

Well I did make a few mistakes sorry try this:

$(eval a=["athena".toLowerCase()];b=["$(touser)".toLowerCase()];"$(user)".toLowerCase()=="$(touser)".toLowerCase()?`You can’t ban yourself!`:a.some(item=>b.includes(item))?`You can’t ban $(touser)!!!`:`You banned $(touser)!`)

Sorry about that.

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