Skip to content

Floofies/babbler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 <code> - Parses source code into a Program AST node. Sending source code
  • /single <code> - 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:

console.log("Hello World!");

(or)

/parse console.log("Hello World!");

This message is recieved from the bot:

{
	"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:

{
	"type": "ExpressionStatement",
	"expression": {
		"type": "Identifier",
		"name": "hello"
	}
}

About

A Telegram bot which converts JavaScript into an AST using Babel.

tg://resolve?domain=babblerjsbot

Topics

Resources

License

Stars

Watchers

Forks

Contributors