1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

add emoji field for dice

This commit is contained in:
dr_forse
2020-04-27 06:30:05 +01:00
parent e89a552e06
commit 99c63e9eba
5 changed files with 15 additions and 8 deletions

View File

@ -243,7 +243,7 @@ class TestTeleBot:
def test_send_dice(self):
tb = telebot.TeleBot(TOKEN)
ret_msg = tb.send_dice(CHAT_ID)
ret_msg = tb.send_dice(CHAT_ID, emoji='🎯')
assert ret_msg.message_id
assert ret_msg.content_type == 'dice'

View File

@ -18,11 +18,12 @@ def test_json_message():
def test_json_message_with_dice():
jsonstring = r'{"message_id":5560,"from":{"id":879343317,"is_bot":false,"first_name":"George","last_name":"Forse","username":"dr_fxrse","language_code":"ru"},"chat":{"id":879343317,"first_name":"George","last_name":"Forse","username":"dr_fxrse","type":"private"},"date":1586926330,"dice":{"value":4}}'
jsonstring = r'{"message_id":5560,"from":{"id":879343317,"is_bot":false,"first_name":"George","last_name":"Forse","username":"dr_fxrse","language_code":"ru"},"chat":{"id":879343317,"first_name":"George","last_name":"Forse","username":"dr_fxrse","type":"private"},"date":1586926330,"dice":{"value": 4, "emoji": "\ud83c\udfb2"}}'
msg = types.Message.de_json(jsonstring)
assert msg.content_type == 'dice'
assert isinstance(msg.dice, types.Dice)
assert msg.dice.value == 4
assert msg.dice.emoji == '🎯'
def test_json_message_group():