https://github.com/nuetoban/crocodile-game-bot
🐊 Crocodile Game bot for Telegram
https://github.com/nuetoban/crocodile-game-bot
bot go golang telegram telegram-bot
Last synced: 5 months ago
JSON representation
🐊 Crocodile Game bot for Telegram
- Host: GitHub
- URL: https://github.com/nuetoban/crocodile-game-bot
- Owner: nuetoban
- License: gpl-3.0
- Created: 2019-12-15T11:57:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-01-15T11:48:01.000Z (over 5 years ago)
- Last Synced: 2024-06-18T23:17:33.878Z (about 2 years ago)
- Topics: bot, go, golang, telegram, telegram-bot
- Language: Go
- Homepage:
- Size: 742 KB
- Stars: 25
- Watchers: 3
- Forks: 27
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Crocodile Game Bot
This is a Crocodile Game bot for Telegram.
I'm not sure that such game is called "Crocodile" in English,
but in Russian it's called that way. `¯\_(ツ)_/¯`
The main bot instance is here: https://t.me/Crocodile_Game_Bot
# ⚠️ This repo is no longer maintained
We've migrated to a private repository.
## Installation
```
go get -u github.com/nuetoban/crocodile-game-bot
```
## Running
1. Copy .env.example to .env and fill variables
```
cp .env{.example,} # Copy
vim .env # Edit
source <(cat .env | awk '{print "export", $1}') # Set variables
```
2. Run redis and postgresql
```
docker-compose up -d redis
docker-compose up -d postgresql
```
3. Apply migrations — see "Database Migrations" section
```
make migrate-up
```
4. Run application
```
make run
```
## Testing
Execute this command:
```
make test
```
## Database Migrations
We use https://github.com/golang-migrate/migrate to perform migrations.
Them are stored in ./migrations/ folder.
To apply migrations to your database do the following:
1. Install `migrate` tool: https://github.com/golang-migrate/migrate/tree/master/cmd/migrate
2. Apply migrations
```
migrate -source file://migrations -database 'postgres://user:pass@localhost:5432/postgres?sslmode=disable' up
```
If you need to downgrade the database schema, run this command
```
migrate -source file://migrations -database 'postgres://user:pass@localhost:5432/postgres?sslmode=disable' down
```
Just `down` instead of `up` in the end of the command.