Firebot
Firebot copied to clipboard
[Feature Request] Add base64 encoding / decoding as a ReplaceVariable
Describe the solution you'd like
I have a firebot effect that writes a JSON blob to a file. To avoid any kind of quoting issue I would like to encode that blob to base64 first. I did not find a ReplaceVariable to do this (other than custom JS) so I would like to add these replacement variables:
$base64encode["Hello, World!"]
// => SGVsbG8gd29ybGQ=
$base64decode["SGVsbG8gd29ybGQ="]
// => Hello, World!
These would just be wrappers around TextEncoder / TextDecoder / btoa / atob.
Additional context
-
I have already written this code for my own use as a custom script, but I thought these would be useful for core Firebot. A PR is ready to go upon dev approval.
-
I named these as I did because I think more people will understand "base64" than "btoa".