Skip to content

A Telegram bot written in Python to play the game BlackJack alone or with your friends

License

Notifications You must be signed in to change notification settings

dfyzicka/o4ko

 
 

Repository files navigation

Build Status Docker Image Version (latest semver) Coverage Status Codacy Badge

Python-BlackJackBot

This is the code for my Telegram Bot with which you can play the game Black Jack. You can find the hosted version of it here: https://telegram.me/BlackJackBot

Setup

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. 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.

Then you're left with several ways to run this bot.

1.) Cloning the repo

If you want to run this code from source, you can just git clone this repo. It's recommended to create a new virtual environment (python3 -m venv /path/to/venv). This bot uses the python-telegram-bot framework to make Telegram API calls. You can install it (and potential other requlrements) like that:

pip install -r requirements.txt

Afterwards just run python3 bot.py and if done right, you'll be left with a working bot.

2.) Docker

This project also contains a Dockerfile as well as a pre-built Docker image hosted on the official Docker Hub.

You will also find the docker-compose.yml file with which you can easily set up your own instance of the bot. Just specify the path to your config etc. in said docker-compose file.


The config.py is never included into the container since it contains secrets (such as the bot token). I explicitly excluded it via the .dockerignore file

Python-BlackJackBot/.dockerignore

Line 103 in 3d93215

config.py Instead you should mount the file via a docker volume.

docker run -v ./config.py:/blackjackbot/config.py blackjack

About

A Telegram bot written in Python to play the game BlackJack alone or with your friends

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.7%
  • Dockerfile 0.3%