https://github.com/gebv/pub7
engine for messager bots
https://github.com/gebv/pub7
bot collector telegram
Last synced: 10 months ago
JSON representation
engine for messager bots
- Host: GitHub
- URL: https://github.com/gebv/pub7
- Owner: gebv
- License: mit
- Created: 2017-08-15T06:47:49.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-18T06:31:05.000Z (almost 9 years ago)
- Last Synced: 2025-04-03T23:14:25.580Z (about 1 year ago)
- Topics: bot, collector, telegram
- Language: Go
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pub7
# Features
* to collect user data
* communicate according to the script
# Status
Not Ready for production
# Examples
## example 1
Diagram

Script
``` toml
[[nodes]]
id = "start"
text = "Hi, i am robot."
next = "q_what_name"
before = '''
if #ctx:get("name") > 0 then
ctx:redirect("q1")
end
'''
transit = true
[[nodes]]
id = "setname"
next = "q_what_name"
transit = true
[[nodes]]
id = "q_what_name"
text = "What's your name?"
next = "h_what_name"
[[nodes]]
id = "h_what_name"
handler = '''
if ctx:text() == "" then
print("empty name")
ctx:redirect("q_what_name")
end
'''
next = "q1"
param = "name"
transit = true
[[nodes]]
id = "q1"
text = "{{.name}} how much 19+15 is?"
next = "h_q1"
[[nodes]]
id = "h_q1"
handler = '''
print("h_q1", ctx:text())
if ctx:text() == "34" then
ctx:redirect("finish")
else
ctx:send("No, try again")
ctx:redirect("q1")
end
'''
transit = true
[[nodes]]
id = "finish"
text = "Right! Again? /start"
```
# Quick start
``` shell
source .env # tarantool config
broombot -file scripts/example.toml run
```