tatsuscript
v2.1.0
Published
An Interpreter for Tatsumaki Tags
Downloads
18
Maintainers
Readme
TatsuScript
A Tatsumaki tag script interpreter
Installing
npm install tatsuscript --save
Usage
const TatsuScript = require('tatsuscript');
let script = '{abs;-1}'; // the absolute function
let output = TatsuScript.run(script, message); // the message is the context the command was run in
console.log(output); // 1
Registering custom functions
Example using Discord.JS
TatsuScript.registerFunction('sendfile', function (url) {
url = this.interpret(url); // url should be interpreted, it's a token
this.context.channel.send(new Discord.MessageAttachment(url));
return `Sent file to ${this.context.channel.name}`;
});