tatsuscript

2.1.0 • Public • Published

TatsuScript

David GitHub license npm

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}`;
});

Package Sidebar

Install

npm i tatsuscript

Weekly Downloads

3

Version

2.1.0

License

MIT

Unpacked Size

34 kB

Total Files

63

Last publish

Collaborators

  • nirewen