CactusDev/CactusBot

Variables as variable defaults don't work

Opened this issue · 8 comments

What is the issue?

When you put a variable as the default for another variable, it doesn't work, it returns the variable as it is.

How do we reproduce this issue?

image
Do that.

Environment

Remote hosted CactusBot 0.4

Other Information

I feel as though it should work because it would make default arguments much coolio-er. 😄

Also: default arguments for %ARGS% doesn't work, it returns Not enough arguments

Hmm... this wasn't really considered. Could look into it, just making sure that recursion isn't an issue. 👍

Yeah, that would be a mild issue. XD

Fixed this in #295

Silly @Innectic. ;P

Can confirm, am noob.

You Innectato!

So, I was thinking about this, and I would that only having one layer-o'-recursion would be fine, anything beyond that would just be pointless and redundant in my opinion.

One layer:   %ARGS=%NAME%%           #Would work
Two layers:  %ARGS=%ARG1=%NAME%%%    #Wouldn't work

If that makes any sense.

And it should check to see if they are the same so that it can't do something like %ARGS=%ARGS%%

I would agree; having more than one layer doesn't really make sense.

The more I think about it, the more I think recursion might not be an issue... for example, with the response %ARG1=%ARG2%% %ARG2=%ARG1%%:

  • If no args, error message.
  • If only %ARG1% as a, response is a a.
  • If also %ARG2% as b, response is a b.