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

Voice bug fix.

This commit is contained in:
eternnoir 2015-08-19 18:25:08 +08:00
parent 571a0fb320
commit 1517979bf2
3 changed files with 3 additions and 3 deletions

View File

@ -254,7 +254,7 @@ class Voice(JsonDeserializable):
mime_type = obj['mime_type']
if 'file_size' in obj:
file_size = obj['file_size']
return Audio(file_id, duration, mime_type, file_size)
return Voice(file_id, duration, mime_type, file_size)
def __init__(self, file_id, duration, mime_type=None, file_size=None):
self.file_id = file_id

View File

@ -197,6 +197,4 @@ def test_not_string():
i1 = 10
assert not apihelper.is_string(i1)
test_send_voice()
test_send_audio()

View File

@ -112,3 +112,5 @@ def test_json_voice():
voice = types.Voice.de_json(json_string)
assert voice.duration == 0
assert voice.file_size == 10481
test_json_voice()