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.
- Host: GitHub
- URL: https://github.com/strml/js-slack-bot
- Owner: STRML
- Created: 2016-06-06T18:27:09.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-12-13T23:23:49.000Z (over 3 years ago)
- Last Synced: 2025-04-11T03:13:11.099Z (12 months ago)
- Language: JavaScript
- Size: 434 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
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 {};
```