Command with different output if argument added after it

Hello, I want to create a particular command that give a different output if an argument was add after the command.
I want to do this:
!hug -> $(user) hugs $(channel) -> User hugs wily_wolf
but if you add an argument it should switch channel name with the argument after !hug
!hug John -> User hugs John

Basically I would have a single command that operates differently depending of the presence or not of a name after it
Is it possible? Or if no is there a way to do this?

It is not possible to do exactly what you want without a customapi (which would be a bit much for something like this). I would recommend creating two commands. One called !hug and one called !hugs

!hug: $(user) hugs $(channel)
!hugs: $(user) hugs $(1)

!hugs will allow you to say a name and it will be replaced where $(1) is.

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