Nightbot If argument

So I’d like to get help with a command i came up with.
It would be , if a pecific user types something then nightbot responses.
Example :
If @Nightbotfriend types Hi , then nightbot answers with something
If @everyoneelse types Hi, nightbot doesnt answers

Yes this is possible using the following command setup:

!addcom Hi $(eval `$(user)`==`nightbotfriend`?`RESPONSE`:` `)

Hope this helped :slight_smile:

Thank you so much ! <3

1 More thing , can you make it so if the pecific types in it says that , but if other types it then it answers something else :smiley:
example :
if types Hi , nightbot answer hello , but if someone else says hi , nightbot answers Greetings
Do u get it what i mean ? :open_mouth:

Yes just do this:

!addcom Hi $(eval `$(user)`==`nightbotfriend`?`RESPONSE1`:`RESPONSE2`)

Response 1 is what “nigtbotfriend” gets.
Response 2 is what everyone else gets.

Thank you :slight_smile:

And can there be 2 names like
!addcom Hi $(eval $(user)==guy1;guy2?RESPONSE1:RESPONSE2)

the best way to do that would be like this:

!addcom Hi $(eval `$(user)`==`USER1`?`RESPONSE1`:`$(user)`==`USER2`?`RESPONSE1`:`RESPONSE2`)

Note: type the usernames in all lowercase for it to work properly also no “@“ symbol.
There are other ways to add more users but this way is simplist since you only have 2 users.

It works properly , thanks

Hey there !

I really appreciate your work , and I would like to have 1 more request !

Can you make that command to 4-5 user please ?

That would be my last one to you :smiley:

Ok this should work:

$(eval a=["$(user)"];b=["USER1","USER2","USER3","USER4","USER5"];function compare(a) {return a.some(item=>b.includes(item))};compare(a)?"Response1":"Response2")

Obviously type the user names in all lowercase. And response 1 is what it says if one of them uses it.

Much thanks for your work <3

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