https://github.com/floofies/babbler
A Telegram bot which converts JavaScript into an AST using Babel.
https://github.com/floofies/babbler
abstract-syntax-tree babel chatbot javascript telegram-bot telegram-bot-api
Last synced: about 1 month ago
JSON representation
A Telegram bot which converts JavaScript into an AST using Babel.
- Host: GitHub
- URL: https://github.com/floofies/babbler
- Owner: Floofies
- License: mit
- Created: 2019-02-01T06:38:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-17T13:12:38.000Z (over 7 years ago)
- Last Synced: 2025-01-28T23:28:36.891Z (over 1 year ago)
- Topics: abstract-syntax-tree, babel, chatbot, javascript, telegram-bot, telegram-bot-api
- Language: JavaScript
- Homepage: tg://resolve?domain=babblerjsbot
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babbler
A Telegram bot which converts JavaScript into an Abstract Syntax Tree using Babel.
To use the bot, just send JavaScript source code directly to it or use one of the below commands.
## Commands
- `/parse ` - Parses source code into a `Program` AST node. Sending source code
- `/single ` - Parses a single atom of source code. (One expression, statement, etc...)
- `/help` - Shows a list of commands.
## `/parse` Command Usage or Direct Message
One of these messages is sent to the bot:
```JavaScript
console.log("Hello World!");
```
*(or)*
```
/parse console.log("Hello World!");
```
This message is recieved from the bot:
```JSON
{
"type": "Program",
"sourceType": "module",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"object": {
"type": "Identifier",
"name": "console"
},
"property": {
"type": "Identifier",
"name": "log"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"extra": {
"rawValue": "Hello World!",
"raw": "\"Hello World!\""
},
"value": "Hello World!"
}
]
}
}
],
"directives": []
}
```
## 2: `/single` Command Usage
This message is sent directly to the bot:
```/single hello```
This message is recieved from bot:
```JSON
{
"type": "ExpressionStatement",
"expression": {
"type": "Identifier",
"name": "hello"
}
}
```