Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/g4s8/openbots
Telegram bot framework with declarative YAML specification
https://github.com/g4s8/openbots
go telegram telegram-bot yaml
Last synced: 2 months ago
JSON representation
Telegram bot framework with declarative YAML specification
- Host: GitHub
- URL: https://github.com/g4s8/openbots
- Owner: g4s8
- License: mit
- Created: 2022-08-18T08:49:23.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-11T11:56:59.000Z (6 months ago)
- Last Synced: 2024-11-21T00:08:06.171Z (3 months ago)
- Topics: go, telegram, telegram-bot, yaml
- Language: Go
- Homepage: https://g4s8.github.io/openbots
- Size: 229 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Telegram Bot framework with declarative YAML specification.
[![CI](https://github.com/g4s8/openbots/actions/workflows/go.yml/badge.svg)](https://github.com/g4s8/openbots/actions/workflows/go.yml)
[![Docker Pulls](https://img.shields.io/docker/pulls/g4s8/openbots)](https://hub.docker.com/r/g4s8/openbots)## Example
Write bot specification in `bot.yml` file:
```yaml
bot:
handlers:
- on:
message:
command: start
reply:
- message:
text: Hello
markup:
keyboard:
- ["Hello!"]
- ["How are you?"]
- on:
message: "Hello!"
reply:
- message:
text: "Hi!"
- on:
message: "How are you?"
reply:
- message:
text: "I'm fine, thank you"
```
Create new Telegram bot and get its token: https://core.telegram.org/bots#6-botfatherProvide this token to docker image as `BOT_TOKEN` environment.
Run your bot:
```sh
docker run \
-v $PWD/bot.yml:/w/config.yml \
--env BOT_TOKEN="$BOT_TOKEN" \
g4s8/openbots:latest
```## Quick start
See [quick start](https://g4s8.github.io/openbots/quickstart/) guide to create Telegram bot in minutes.
## Documentation
The full documentation is available here: [g4s8.github.io/openbots/documentation](https://g4s8.github.io/openbots/documentation/).
## About
This is a Telegram bot framework which allows you to write low-code bot project. You delcare the bot in YAML specification
file and start the bot using CLI or Docker image.Full feature list:
- [x] handle text messages
- [x] handle bot commands
- [x] handle inline queries callbacks (buttons)
- [x] reply with text messages
- [x] reply callbacks
- [x] reply with inline buttons
- [x] change keyboard layout (reply markup)
- [x] reply with Markup, MarkupV2, HTML messages
- [x] switch context, handle context-based updates
- [x] keep state data and interpolate state in replies
- [x] edit message
- [x] reply with images
- [ ] handle image messages
- [x] delete messages
- [x] API:
- [x] send message to particular user
- [x] call webhook on update
- [x] database storage
- [x] payments
- [x] validation
- [x] state operations
## PersistenceBot can keep its state in two modes:
- `memory` - store all data in memory
- `database` - connect PostgreSQL databaseFor persistence configuration see [documentation](https://g4s8.github.io/openbots/persistence).
## Extending
This bot could be extended with custom handlers on Go.