Skip to content

[Feature Request] Add base64 encoding / decoding as a ReplaceVariable #3186

@TheStaticMage

Description

@TheStaticMage

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".

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions