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

Add request_poll attribute to KeyboardButton;

Add KeyboardButtonPollType object
This commit is contained in:
oleg
2020-05-06 13:23:39 +05:00
parent 783fe56566
commit 03b02561a5
2 changed files with 21 additions and 3 deletions

View File

@ -188,3 +188,11 @@ def test_json_poll_answer():
assert poll_answer.poll_id == '5895675970559410186'
assert isinstance(poll_answer.user, types.User)
assert poll_answer.options_ids == [1]
def test_KeyboardButtonPollType():
markup = types.ReplyKeyboardMarkup()
markup.add(types.KeyboardButton('send me a poll', request_poll=types.KeyboardButtonPollType(type='quiz')))
json_str = markup.to_json()
assert 'request_poll' in json_str
assert 'quiz' in json_str