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:
parent
571a0fb320
commit
1517979bf2
@ -254,7 +254,7 @@ class Voice(JsonDeserializable):
|
|||||||
mime_type = obj['mime_type']
|
mime_type = obj['mime_type']
|
||||||
if 'file_size' in obj:
|
if 'file_size' in obj:
|
||||||
file_size = obj['file_size']
|
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):
|
def __init__(self, file_id, duration, mime_type=None, file_size=None):
|
||||||
self.file_id = file_id
|
self.file_id = file_id
|
||||||
|
@ -197,6 +197,4 @@ def test_not_string():
|
|||||||
i1 = 10
|
i1 = 10
|
||||||
assert not apihelper.is_string(i1)
|
assert not apihelper.is_string(i1)
|
||||||
|
|
||||||
|
|
||||||
test_send_voice()
|
test_send_voice()
|
||||||
test_send_audio()
|
|
||||||
|
@ -112,3 +112,5 @@ def test_json_voice():
|
|||||||
voice = types.Voice.de_json(json_string)
|
voice = types.Voice.de_json(json_string)
|
||||||
assert voice.duration == 0
|
assert voice.duration == 0
|
||||||
assert voice.file_size == 10481
|
assert voice.file_size == 10481
|
||||||
|
|
||||||
|
test_json_voice()
|
||||||
|
Loading…
Reference in New Issue
Block a user