Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MasterGroosha/telegram-casino-bot
Demo bot to show slot machine dice 🎰 on Telegram
https://github.com/MasterGroosha/telegram-casino-bot
aiogram3 bot casino dice game telegram telegram-bot telegram-bot-api
Last synced: 3 months ago
JSON representation
Demo bot to show slot machine dice 🎰 on Telegram
- Host: GitHub
- URL: https://github.com/MasterGroosha/telegram-casino-bot
- Owner: MasterGroosha
- License: mit
- Created: 2020-11-11T10:51:41.000Z (almost 4 years ago)
- Default Branch: aiogram3
- Last Pushed: 2024-03-13T23:04:56.000Z (8 months ago)
- Last Synced: 2024-06-16T07:33:04.213Z (5 months ago)
- Topics: aiogram3, bot, casino, dice, game, telegram, telegram-bot, telegram-bot-api
- Language: Python
- Homepage: https://t.me/DifichentoBot
- Size: 94.7 KB
- Stars: 140
- Watchers: 4
- Forks: 34
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://t.me/DifichentoBot) (Ru)
> 🇷🇺 README на русском доступен [здесь](README.ru.md)
# Telegram Virtual Casino
In October 2020 Telegram team released [yet another update](https://telegram.org/blog/pinned-messages-locations-playlists)
with slot machine dice. Here it is:![slot machine dice](repo_images/slot_machine.png)
According to [Dice type documentation](https://core.telegram.org/bots/api#dice) in Bot API, slot machine
emits values 1 to 64. In [dice_check.py](bot/dice_check.py) file you can find all the logic regarding
matching dice integer value with visual three-icons representation. There is also a test bot [@DifichentoBot](https://t.me/difichentobot)
in Russian to test how it works.
Dice are generated on Telegram server-side, you your bot cannot affect the result.## Technology
* [aiogram](https://github.com/aiogram/aiogram) — asyncio Telegram Bot API framework;
* [redis](https://redis.io) — persistent data storage (persistency enabled separately);
* [cachetools](https://cachetools.readthedocs.io/en/stable) — for anti-flood throttling mechanism;
* [Docker](https://www.docker.com) and [Docker-Compose](https://docs.docker.com/compose) — quickly deploy bot in containers.
* Systemd## Installation
Copy `env_example` file to `.env` (with leading dot), open and edit it. Create `redis_data` and `redis_config`
directories, put `redis.conf` file into the latter (there is [example](redis.example.conf) in this repo).
Create `locales` folder with languages subdirs (e.g. `locales/en`) and put your localization file(s) in those subdirs.
Check [this directory](bot/locales/example) for samples. Please note that only one language can be active at a time.Finally, run the bot with `docker-compose up -d` command.
Alternative way: you can use Systemd services, there is also an [example](casino-bot.example.service) available.
## Credits to
* [@Tishka17](https://t.me/Tishka17) for initial inspiration
* [@svinerus](https://t.me/svinerus) for compact dice combination check (f6f42a841d3c1778f0e32)