refactor: python -> go
All checks were successful
ci/woodpecker/tag/release Pipeline was successful

This commit is contained in:
Felipe M 2025-04-20 13:54:22 +02:00
parent 9c78ea2d48
commit 7c684af8c3
Signed by: fmartingr
GPG key ID: CCFBC5637D4000A8
79 changed files with 3594 additions and 3257 deletions

View file

@ -2,52 +2,78 @@
| Stable | Master |
| --- | --- |
| ![Build stable tag docker image](https://github.com/fmartingr/butterrobot/workflows/Build%20stable%20tag%20docker%20image/badge.svg?branch=stable) | ![Build latest tag docker image](https://github.com/fmartingr/butterrobot/workflows/Build%20latest%20tag%20docker%20image/badge.svg?branch=master) |
| ![Pytest](https://github.com/fmartingr/butterrobot/workflows/Pytest/badge.svg?branch=stable) | ![Pytest](https://github.com/fmartingr/butterrobot/workflows/Pytest/badge.svg?branch=master) |
| ![Build stable tag docker image](https://git.nakama.town/fmartingr/butterrobot/workflows/Build%20stable%20tag%20docker%20image/badge.svg?branch=stable) | ![Build latest tag docker image](https://git.nakama.town/fmartingr/butterrobot/workflows/Build%20latest%20tag%20docker%20image/badge.svg?branch=master) |
| ![Test](https://git.nakama.town/fmartingr/butterrobot/workflows/Test/badge.svg?branch=stable) | ![Test](https://git.nakama.town/fmartingr/butterrobot/workflows/Test/badge.svg?branch=master) |
Python framework to create bots for several platforms.
Go framework to create bots for several platforms.
![Butter Robot](./assets/icon@120.png)
> What is my purpose?
## Features
- Support for multiple chat platforms (Slack, Telegram)
- Plugin system for easy extension
- Admin interface for managing channels and plugins
- Message queue for asynchronous processing
## Documentation
[Go to documentation](./docs)
## Installation
### PyPi
### From Source
You can run it directly by installing the package and calling it
with `python` though this is not recommended and only intended for
development purposes.
```bash
# Clone the repository
git clone https://git.nakama.town/fmartingr/butterrobot.git
cd butterrobot
```
$ pip install --user butterrobot
$ python -m butterrobot
# Build the application
go build -o butterrobot ./cmd/butterrobot
```
### Containers
The `fmartingr/butterrobot/butterrobot` container image is published on Github packages to use with your favourite tool:
The `fmartingr/butterrobot/butterrobot` container image is published on Github packages:
```bash
docker pull docker.pkg.git.nakama.town/fmartingr/butterrobot/butterrobot:latest
docker run -d --name butterrobot -p 8080:8080 docker.pkg.git.nakama.town/fmartingr/butterrobot/butterrobot:latest
```
docker pull docker.pkg.github.com/fmartingr/butterrobot/butterrobot:latest
podman run -d --name fmartingr/butterrobot/butterrobot -p 8080:8080
```
## Configuration
Configuration is done through environment variables:
- `DEBUG`: Set to "y" to enable debug mode
- `BUTTERROBOT_HOSTNAME`: Hostname for webhook URLs
- `LOG_LEVEL`: Logging level (DEBUG, INFO, WARN, ERROR)
- `SECRET_KEY`: Secret key for sessions and password hashing
- `DATABASE_PATH`: Path to SQLite database file
### Platform-specific configuration
#### Slack
- `SLACK_TOKEN`: Slack app access token
- `SLACK_BOT_OAUTH_ACCESS_TOKEN`: Slack bot OAuth access token
#### Telegram
- `TELEGRAM_TOKEN`: Telegram bot token
## Contributing
To run the project locally you will need [poetry](https://python-poetry.org/).
```
```bash
git clone git@github.com:fmartingr/butterrobot.git
cd butterrobot
poetry install
go mod download
```
Create a `.env-local` file with the required environment variables, you have [an example file](.env-example).
Create a `.env-local` file with the required environment variables:
```
SLACK_TOKEN=xxx
@ -55,8 +81,12 @@ TELEGRAM_TOKEN=xxx
...
```
And then you can run it directly with poetry
And then you can run it directly:
```bash
go run ./cmd/butterrobot/main.go
```
docker run -it --rm --env-file .env-local -p 5000:5000 -v $PWD/butterrobot:/etc/app/butterrobot local/butterrobot python -m butterrobot
```
## License
GPL-2.0