Update results.py

This commit is contained in:
Flowiee 2019-10-14 20:08:16 +02:00 committed by GitHub
parent d5a3376eff
commit 7d3be19196
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -130,6 +130,18 @@ def add_mode_wild(results):
)
def add_mode_text(results):
"""Change mode to text"""
results.append(
InlineQueryResultArticle(
"mode_text",
title=_("✍️ Text mode"),
input_message_content=
InputTextMessageContent(_('Text ✍️'))
)
)
def add_draw(player, results):
"""Add option to draw"""
n = player.game.draw_counter or 1
@ -187,9 +199,14 @@ def add_card(game, card, results, can_play):
"""Add an option that represents a card"""
if can_play:
if game.mode != "text":
results.append(
Sticker(str(card), sticker_file_id=c.STICKERS[str(card)])
)
if game.mode == "text":
results.append(
Sticker(str(card), sticker_file_id=c.STICKERS[str(card)], input_message_content=InputTextMessageContent("Card Played: {card}".format(card=repr(card)))
))
else:
results.append(
Sticker(str(uuid4()), sticker_file_id=c.STICKERS_GREY[str(card)],