|
1 | | -[](https://travis-ci.com/d-Rickyy-b/Python-BlackJackBot) |
| 1 | + |
| 2 | +[](https://github.com/d-Rickyy-b/Python-BlackJackBot/actions/workflows/python-lint-test.yml) |
2 | 3 | [](https://coveralls.io/github/d-Rickyy-b/Python-BlackJackBot?branch=rebuild) |
3 | 4 | [](https://www.codacy.com/manual/d-Rickyy-b/Python-BlackJackBot?utm_source=github.com&utm_medium=referral&utm_content=d-Rickyy-b/Python-BlackJackBot&utm_campaign=Badge_Grade) |
4 | 5 |
|
5 | 6 | # Python-BlackJackBot |
6 | 7 |
|
7 | | -This is the code for my Telegram Bot with which you can play the game Black Jack. You can find it here: https://telegram.me/BlackJackBot |
8 | | - |
9 | | -The main file, which needs to be executed is 'main.py'. Please create a copy of the config.sample.py, name it config.py and enter the config data (e.g. bot |
10 | | - token). |
| 8 | +This is the code for my Telegram Bot with which you can play the game Black Jack. |
| 9 | +You can find the hosted version of it here: https://telegram.me/BlackJackBot |
11 | 10 |
|
12 | 11 | ## Setup |
| 12 | +This project is really easy to set up. No matter which of the following ways you'll use, you'll always need a config file. |
| 13 | +To create one, simply copy the existing `config.sample.py` file and name it `config.py`. Enter your bot token and make your changes accordingly. |
13 | 14 |
|
14 | | -The bot uses the [python-telegram-bot](https://python-telegram-bot.org/) framework to make Telegram API calls. You can install it like that: |
| 15 | +Then you're left with several ways to run this bot. |
| 16 | + |
| 17 | +### 1.) Cloning the repo |
| 18 | +If you want to run this code from source, you can just `git clone` this repo. |
| 19 | +It's recommended to create a new virtual environment (`python3 -m venv /path/to/venv`). |
| 20 | +This bot uses the [python-telegram-bot](https://python-telegram-bot.org/) framework to make Telegram API calls. |
| 21 | +You can install it (and potential other requlrements) like that: |
15 | 22 |
|
16 | 23 | ``pip install -r requirements.txt`` |
17 | 24 |
|
18 | | -## Database |
| 25 | +Afterwards just run `python3 bot.py` and if done right, you'll be left with a working bot. |
| 26 | + |
| 27 | +### 2.) Docker |
| 28 | +This project also contains a `Dockerfile` as well as a pre-built [Docker image](https://hub.docker.com/repository/docker/0rickyy0/blackjackbot) hosted on the official Docker Hub. |
19 | 29 |
|
20 | | -The bot uses a SQLite database. The database file is in the "database" directory. It is called 'users.db'. The database gets auto-generated, if it doesn't exist. Make sure the program has write access to the database directory. |
| 30 | +You will also find the `docker-compose.yml` file with which you can easily set up your own instance of the bot. |
| 31 | +Just specify the path to your config etc. in said docker-compose file. |
0 commit comments