Been looking around on different topics and the docs but haven’t found a way to do this. Is it possible to have a command that appends to an existing one?
For example, it’d work like:
!favorites → UserA
!addfav UserB → !favorites is then “UserA, UserB”
!addfav UserC → !favorites is then “UserA, UserB, UserC”
Basically looking for a way to reference the current command response in the alias and add the new query parameter at the end.
Didn’t see anything in the argument list that’d work like that and not sure calling the NightbotAPI via the urlfetch argument is a good idea or even supported.
Not possible to do natively in Nightbot, but a workaround exists using ehsan’s quote API.
Click this link. It will generate three links and two tokens, a public token (8 characters long) and a private token (16 characters long). The public token is located within the first generated link. The private token is located within both the second and third generated links. The tokens are found after token= and before &data=$(querystring)Copy them down and keep them somewhere safe!
I set up 3 commands below: !favorites which shows the list of phrases you have compiled, !addfav (mod-only) which lets you append a new phrase to the list, and !resetfav (mod-only) which clears the list. Copy and paste the following setups into chat. Replace PUBLIC_TOKEN with your public token and PRIVATE_TOKEN with your private token:
Thanks, working as expected! One question, is it possible to change the “empty” list text that’s returned?
Right now its says “There are no quotes added”, curious if I can customize that to say something different. Would that be handled inside the eval javascript?