@$(user) Picked a fight with @$(touser). $(eval var sayings = ["$(touser) spanked $(user).", 'It was a draw.', "$(user) Ko'd $(touser) with one punch!", "They're both scared and and neither wants to throw the first punch. BOO!.", "Oh shite! $(touser) has a gun!", "$(user) owned $(touser).", "Stop hitting yourself $(user).", "$(touser) was no match for $(user).", "$(user) is victorious!", "You call that fighting?"]; sayings[Math.floor(Math.random() * sayings.length)];)
I would like to add a clause that always gives a certain response if a certain username is entered. Is it possible with NB? if so how?
I’m assuming you want the response to be the same whether this certain username is the $(user) using the command or the $(touser) being targeted. Use a conditional (if/else) before outputting a random item from the sayings array.
@$(user) Picked a fight with @$(touser). $(eval sayings=["$(touser) spanked $(user).","It was a draw.","$(user) Ko'd $(touser) with one punch!","They're both scared and and neither wants to throw the first punch. BOO!","Oh shite! $(touser) has a gun!","$(user) owned $(touser).","Stop hitting yourself $(user).","$(touser) was no match for $(user).","$(user) is victorious!","You call that fighting?"];"$(user)"=="specificUser"||"$(touser)"=="specificUser"?"[user-specific outcome here]":sayings[Math.floor(Math.random()*sayings.length)];)
If either $(user) or $(touser) is the specific user, it’ll output the alternate outcome. Otherwise, it’ll output a random item from the sayings array. Replace specificUser with the username you want and replace [user-specific outcome here] with your alternate outcome response.
I’d just make the “$(touser)” string lowercase, then compare that to your name:
@$(user) Picked a fight with @$(touser). $(eval sayings=["$(touser) spanked $(user).","It was a draw.","$(user) Ko'd $(touser) with one punch!","Did they just run from each other?","Oh shite! $(touser) has a gun!","$(user) owned $(touser).","Stop hitting yourself $(user).","$(touser) was no match for $(user).","$(user) is victorious!","You call that fighting?"];"$(touser)".toLowerCase()=="ogbrittler"?"OGBrittler was too skilled for $(user)":sayings[Math.floor(Math.random()*sayings.length)];)