ea881cf520
* Changes for possible bug * New sanic mode wip * More changes for fast mode, WIP * Fast mode is playable (code is ugly tho) * Fixed skip error * Fixed fast mode error * Bug fixing * Possible fix for the /leave bug before the game starts * Update README to include Codacy badge * Fixing error prone code * Removing code smells * Removing more code smells * How long can this go on? (More smells according to Codacy) * Compile locale fixed for Linux. Small es_ES fix. * Major refactoring * Wild mode finished. Changed emojis for text in log. * Removing test prints, back to emojis * Code cleaning and fix for player time in fast mode * Changing help to not override builtin function * Decreased bot.py's complexity * Default gamemode is now Fast. Added a bot configuration file * back to random * Moved logger to shared_vars * Added MIN_FAST_TURN_TIME to config and fixed 'skipped 4 times' message * Pull review changes * More review changes * Removing codacy badge linked to my account for pull request * Fixed first special card issue, logger back to how it was (with just one logging init) * Renamed gameplay config file to gameplay_config.py.
1.2 KiB
1.2 KiB
UNO Bot
Telegram Bot that allows you to play the popular card game UNO via inline queries. The bot currently runs as @unobot.
To run the bot yourself, you will need:
- Python (tested with 3.4+)
- The python-telegram-bot module
- Pony ORM
Setup
- Get a bot token from @BotFather and change configurations in
config.json
. - Convert all language files from
.po
files to.mo
by executing the bash scriptcompile.sh
located in thelocales
folder. Another option is:find . -maxdepth 2 -type d -name 'LC_MESSAGES' -exec bash -c 'msgfmt {}/unobot.po -o {}/unobot.mo' \;
. - Use
/setinline
and/setinlinefeedback
with BotFather for your bot. - Install requirements (using a
virtualenv
is recommended):pip install -r requirements.txt
You can change some gameplay parameters like turn times, minimum amount of players and default gamemode in gameplay_config.py
. Check the gamemodes available with the /modes
command.
Then run the bot with python3 bot.py
.
Code documentation is minimal but there.