Categorygithub.com/nuetoban/crocodile-game-bot
modulepackage
0.1.1
Repository: https://github.com/nuetoban/crocodile-game-bot.git
Documentation: pkg.go.dev

# 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

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
  1. Run redis and postgresql
docker-compose up -d redis
docker-compose up -d postgresql
  1. Apply migrations — see "Database Migrations" section
make migrate-up
  1. 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.

Contributing

  1. Fork it (https://github.com/nuetoban/crocodile-game-bot)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Check out our Trello board if you have no idea what to do 😊

Contact

Architecture

Architecture

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

NewRateLimiter returns new instance of RateLimiter.

# Variables

No description provided by the author

# Structs

RateLimiter -.

# Interfaces

No description provided by the author
No description provided by the author