Update utils.py

This commit is contained in:
Flowiee 2019-10-17 16:58:11 +02:00 committed by GitHub
parent fd075a8535
commit 39aad0cc9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,6 +25,7 @@ from telegram.ext.dispatcher import run_async
from internationalization import _, __
from mwt import MWT
from shared_vars import gm
import card as c
logger = logging.getLogger(__name__)
@ -77,6 +78,24 @@ def display_color_group(color, game):
emoji='💛')
def display_card_text(card):
if card.special == c.DRAW_FOUR:
return __("⬛️+4")
if card.special == c.CHOOSE:
return __("Color Chooser")
if card.value == c.DRAW_TWO:
if card.color == 'r':
return __("❤️+2")
if card.color == 'b':
return __("💙+2")
if card.color == 'g':
return __("💚+2")
if card.color == 'y':
return __("💛+2")
else:
return repr(card)
def error(bot, update, error):
"""Simple error handler"""
logger.exception(error)