mirror of
https://github.com/HugeFrog24/go-telegram-bot.git
synced 2026-03-02 00:14:34 +00:00
Upd deps
This commit is contained in:
73
README.md
Executable file → Normal file
73
README.md
Executable file → Normal file
@@ -12,39 +12,38 @@ A scalable, multi-bot solution for Telegram using Go, GORM, and the Anthropic AP
|
||||
|
||||
## Usage
|
||||
|
||||
1. Clone the repository or install using `go get`:
|
||||
- Option 1: Clone the repository
|
||||
```bash
|
||||
git clone https://github.com/HugeFrog24/go-telegram-bot.git
|
||||
```
|
||||
|
||||
- Option 2: Install using go get
|
||||
```bash
|
||||
go get -u github.com/HugeFrog24/go-telegram-bot
|
||||
```
|
||||
### Docker Deployment (Recommended)
|
||||
|
||||
- Navigate to the project directory:
|
||||
```bash
|
||||
cd go-telegram-bot
|
||||
```
|
||||
1. Clone the repository:
|
||||
```bash
|
||||
git clone https://github.com/HugeFrog24/go-telegram-bot.git
|
||||
cd go-telegram-bot
|
||||
```
|
||||
|
||||
2. Copy the default config template and edit it:
|
||||
```bash
|
||||
cp config/default.json config/config-mybot.json
|
||||
cp config/default.json config/mybot.json
|
||||
nano config/mybot.json
|
||||
```
|
||||
|
||||
Replace `config-mybot.json` with the name of your bot.
|
||||
|
||||
```bash
|
||||
nano config/config-mybot.json
|
||||
```
|
||||
|
||||
You can set up as many bots as you want. Just copy the template and edit the parameters.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> [!IMPORTANT]
|
||||
> Keep your config files secret and do not commit them to version control.
|
||||
|
||||
3. Build the application:
|
||||
3. Create data directory and run:
|
||||
```bash
|
||||
mkdir -p data
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
### Native Deployment
|
||||
|
||||
1. Install using `go get`:
|
||||
```bash
|
||||
go get -u github.com/HugeFrog24/go-telegram-bot
|
||||
cd go-telegram-bot
|
||||
```
|
||||
|
||||
2. Configure as above, then build:
|
||||
```bash
|
||||
go build -o telegram-bot
|
||||
```
|
||||
@@ -76,11 +75,11 @@ To enable the bot to start automatically on system boot and run in the backgroun
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo systemctl enable telegram-bot.service
|
||||
sudo systemctl enable telegram-bot
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo systemctl start telegram-bot.service
|
||||
sudo systemctl start telegram-bot
|
||||
```
|
||||
|
||||
4. Check the status:
|
||||
@@ -93,22 +92,16 @@ For more details on the systemd setup, refer to the [demo service file](examples
|
||||
|
||||
## Logs
|
||||
|
||||
View logs using journalctl:
|
||||
|
||||
### Docker
|
||||
```bash
|
||||
journalctl -u telegram-bot
|
||||
docker-compose logs -f telegram-bot
|
||||
```
|
||||
|
||||
Follow logs:
|
||||
### Systemd
|
||||
```bash
|
||||
journalctl -u telegram-bot -f
|
||||
```
|
||||
|
||||
View errors:
|
||||
```bash
|
||||
journalctl -u telegram-bot -p err
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
The GitHub actions workflow already runs tests on every commit:
|
||||
@@ -119,3 +112,11 @@ However, you can run the tests locally using:
|
||||
```bash
|
||||
go test -race -v ./...
|
||||
```
|
||||
|
||||
## Storage
|
||||
|
||||
At the moment, a SQLite database (`./data/bot.db`) is used for persistent storage.
|
||||
|
||||
Remember to back it up regularly.
|
||||
|
||||
Future versions will support more robust storage backends.
|
||||
|
||||
Reference in New Issue
Block a user