#(LeafyMitsuwa) Additional data action support
1 messages · Page 1 of 1 (latest)
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
Several commands function as a way to modify data values,
including !command flag, !command yaml, and !command define.
These commands each allow for a set of generic data change operations.
These operations can be used with a syntax like "<key>:<action>:<value>"
For example "mykey:+:5" will add 5 to the value at 'mykey'.
The following actions are available:
Actions that take no input value:
Increment: '++': raises the value numerically up by 1. Example: - define x:++
Decrement: '--': lowers the value numerically down by 1. Example: - define x:--
Remove: '!': removes the value entirely. Example: - define x:!
Actions that take an input value:
Add: '+': adds the input value to the value at the key. Example: - define x:+:5
Subtract: '-': subtracts the input value from ...
Useful Lists
At the bottom is examples of what it seems you are looking for
They do, to an extend; but perhaps I am not understanding its full capability.
Can you clarify your exact use case? Im not sure i follow what you are asking
I could, for example:
# Would output li@1|2|4
- define MyDef <list[1|2]>
- define MyDef:->:4
But what if I wanted to add something to the list at a specific index, or remove the last entry, which happens to be occur earlier in the list, of a list of i.e. li@1|2|3|4|2
# Would output li@1|3|4|2
- define MyDef <list[1|2|3|4|2]>
- define MyDef:<-:2
To remove at a specific index that would be define mydef[index]:<-
Thanks 