Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nirewen/tatsuscript
An Interpreter for Tatsumaki Tags
https://github.com/nirewen/tatsuscript
command custom script tags tatsumaki
Last synced: about 2 months ago
JSON representation
An Interpreter for Tatsumaki Tags
- Host: GitHub
- URL: https://github.com/nirewen/tatsuscript
- Owner: nirewen
- License: mit
- Created: 2018-03-18T23:48:45.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T00:54:13.000Z (about 2 years ago)
- Last Synced: 2024-04-27T03:03:32.251Z (9 months ago)
- Topics: command, custom, script, tags, tatsumaki
- Language: JavaScript
- Size: 290 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TatsuScript
[![David](https://img.shields.io/david/nirewen/tatsuscript.png)](https://david-dm.org/nirewen/tatsuscript) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.png)](https://raw.githubusercontent.com/nirewen/tatsucript/master/LICENSE) [![npm](https://img.shields.io/npm/v/tatsuscript.png)](https://npm.im/tatsuscript)
A Tatsumaki tag script interpreter
## Installing
```
npm install tatsuscript --save
```## Usage
```js
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](https://discord.js.org)
```js
TatsuScript.registerFunction('sendfile', function (url) {
url = this.interpret(url); // url should be interpreted, it's a tokenthis.context.channel.send(new Discord.MessageAttachment(url));
return `Sent file to ${this.context.channel.name}`;
});
```