Create a custom command with optional argument and if not, take a default

I want to create a custom command with a optional argument and if not, it takes a default command.

For example (my user is riahc3)

!hello user

Bot replies:

Hello user! Welcome


Bot replies:

Hello riahc3! Welcome

Is there a way to do this?

Hey @riahc3!

I’m not sure I understand fully what you’re looking for, but hopefully using $(touser) is what you need:

!addcom hello Hello $(touser)! Welcome!


I was a command that takes a OPTIONAL argument.


Would reply

Hello riahc3!

!hello anotheruser

Would reply

Hello anotheruser!

Have you given it a try?! It does exactly what you’re asking for…

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