https://github.com/adityapurwa/arubick
Simple bot engine with expressive syntax.
https://github.com/adityapurwa/arubick
bot language
Last synced: 10 months ago
JSON representation
Simple bot engine with expressive syntax.
- Host: GitHub
- URL: https://github.com/adityapurwa/arubick
- Owner: adityapurwa
- License: mit
- Created: 2017-11-27T13:51:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-04T13:01:51.000Z (over 8 years ago)
- Last Synced: 2025-03-12T22:14:18.962Z (over 1 year ago)
- Topics: bot, language
- Language: TypeScript
- Size: 34.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Arubick
> Simple bot engine with expressive syntax.
Arubick is a simple bot engine that runs on Javascript by feeding it a \*.rbot
file that contains expressive syntax of your bot.
```rbot
RandomBot:0.0.1
def ext/random = extern("./js/random.js")
def intent/query = [
"random"
]
def intent/greet = [
"hi",
"hello"
]
main {
def message = await reply()
if message is intent/greet {
say("Hi! I am random bot, ask me for a random number.")
restart()
} else {
if message is intent/query {
def random = ext/random()
say("Generated random number ${random}")
restart()
} else {
say("Sorry, I don't understand")
restart()
}
}
}
```
**ARUBICK IS EXPERIMENTAL PROJECT AND SUBJECT TO FREQUENT CHANGES THAT COULD
BREAKS PREVIOUS VERSION.**
**Arubick is a way for me to learn Antlr, there might be some things that does
not follow Antlr best practice, I am used to write parser manually before.**
## Agnostic Design
Arubick is designed to be agnostic, it is not primarily designed to run limited
to the engine. You should be able to extend (not yet implemented) Arubick to use
external natural language processing engine.
```rbot
def extract = ext/intentQuery(message)
if extract {
say("...")
}
```
## Running Example
To run the example, run the command below
```
npm run test
```
Make sure to install the dependencies first (including development
dependencies).
Where `ext/intentQuery` above is defined as external natural language processor.
## Contribution
This is more like a learning project and research, so feel free to share your
knowledge with me and any form of contribution is accepted.
## Extra
Arubick is named after Rubick, a DoTA 2 hero that can learn the opponent spells.