You are correct. Nightbot currently only allows for 2 levels of variable nesting, and beyond that, variables don’t resolve properly. For example, in your command setups, the $(twitch) variable will attempt to search up the channel name of a Twitch account literally called “$(query)” which will result in the $(twitch) variable resolving to “Unknown Twitch Channel”.
Also, in case you are wondering, this is not a bug of any sort. It’s an intentional restriction.
Argh, thanks. I understand the need to limit this, but as demonstrated both by myself and the thread you reference, 2 layers is exactly one layer too shallow. At least I can’t think of a way to change the data in variables passed to $(urlfetch) without this type of nesting.
!cmd2 looks up the name given in the user’s input, performs a $(urlfetch) with the name, and passes the $(urlfetch) result to _cmd2 which will probably run some JS script to manipulate the information in the passed result.