telegram.Voice

class telegram.Voice(file_id, duration, mime_type=None, file_size=None, **kwargs)

Bases: telegram.base.TelegramObject

This object represents a voice note.

file_id

str – Unique identifier for this file.

duration

int – Duration of the audio in seconds as defined by sender.

mime_type

str – Optional. MIME type of the file as defined by sender.

file_size

int – Optional. File size.

Parameters:
  • file_id (str) – Unique identifier for this file.
  • duration (int, optional) – Duration of the audio in seconds as defined by sender.
  • mime_type (str, optional) – MIME type of the file as defined by sender.
  • file_size (int, optional) – File size.
  • **kwargs (dict) – Arbitrary keyword arguments.