How to escape $(query) for use in $(eval)

I have a command that’s used for helping with video editing by creating a formatted timestamp and then parsing the chat log after the stream.

!ts some label

results in Nightbot responding something like

[2:44:07] @some_user marked a timestamp labeled some label.

How can I escape $(query) so that it loads in a JavaScript string allowing for quotes?

It’s a bit bespoke, but you can probably use

$(eval const input = decodeURIComponent(`$(querystring)`))

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