An open API service indexing awesome lists of open source software.

https://github.com/strml/js-slack-bot

REPL in Slack.
https://github.com/strml/js-slack-bot

Last synced: 12 months ago
JSON representation

REPL in Slack.

Awesome Lists containing this project

README

          

# JS-Slack-Bot

Runs short commands in a secure environment and translate babel code.

### Usage

* Add your [Bot Token](http://.slack.com/services/new/bot) to `.token`
* Deploy this somewhere, or run locally
* `@` mention the bot to run a command.

### Commands

Send it any string with or without backticks to eval directly.

Send it `babel:` or `babel-node6:` (colon is optional) to transpile code.

The Babel transpiler uses most common plugins. You can add your own easily.

#### Example

```
@jsbot Array(16).join("wat" - 1) + " Batman!"
NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman!
```

```
@jsbot babel ``
React.createElement(TimeHacker, { timeTohack: "tooMuchTime" });
```

```
@jsbot babel class Foo {}

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var Foo = function Foo() {
_classCallCheck(this, Foo);
};
```
```
@jsbot babel-node6 class Foo {}
let Foo = class Foo {};
```