Using arguments in $(eval)

So I want to do different commands, based on the first argument, or if it is not known I want to reply with a general response. I got something like this:

!commands edit !hug $(eval 
	if($(1)=="Shaddaaa"||$(1)=="Shaddaa"||$(1)=="Shade") {
		"-a=!hugflo"
        } else {
                if () {                           //other known names
	} else {                                  //else print this:
		"/me umarmt $(touser)! Du fühlst eine Hand in deinen Geldbeutel greifen."
	}
)

A command cannot decide whether it will call another command when it is called. A command can only be an alias to one other command, and that must be set at the time of editing the command.

You can’t do that how you want, as commands can only be aliased by putting a command in the alias section. So you can’t separate an alias from a general message

Keep in mind that nightbot replaces variables literally. For those to work you would need to surround $(1) with quotes, so that in the javascript it can be an actual string.

Hm okey, thanks anyways.

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