Can I make a command that gives a different response if a specific user is mentioned?

Asked Jan 2, 2025·6 replies·Last activity 1 year ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

So I want to make a !headpat command "$(user) gives $(touser) some headpats", and I did that, but there is this user that when mentioned I want it to give a different response like "don't headpat the $(user), he bites"

My question is if that's even possible and how to doit I've been trying and I'm very lost. Thanks in advance.

6 replies

Try:

$(eval `$(touser)`==`NICK HERE`?`don’t headpat the $(touser), he bites`:`$(user) gives $(touser) some headpats`;)

Thank you so much this worked perfectly!

How would i format this to have multiple trigger names

You can't add multiple trigger names via the command response. You'd need to add multiple commands

this ^ but how do you have multiple users to have the neg response to? i added this same command but instead of just having one person to have the don't pat response to, i was trying to get more than one but i don't know how

You can add more nicks with the condition ||:

$(eval `$(touser)`==`NICK1` || `$(touser)`==`NICK2` ?`don’t headpat the $(touser), he bites`:`$(user) gives $(touser) some headpats`;)

Didn't find your answer? The community is on Discord.

Ask on Discord