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

Update Comment.

This commit is contained in:
eternnoir 2015-08-19 18:27:35 +08:00
parent 1517979bf2
commit b17831b726

View File

@ -233,18 +233,29 @@ class TeleBot:
def send_audio(self, chat_id, audio, duration=None, performer=None, title=None, reply_to_message_id=None, reply_markup=None): def send_audio(self, chat_id, audio, duration=None, performer=None, title=None, reply_to_message_id=None, reply_markup=None):
""" """
Use this method to send audio files, if you want Telegram clients to display the file as a playable Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format.
voice message. For this to work, your audio must be in an .ogg file encoded with OPUS :param chat_id:Unique identifier for the message recipient
:param chat_id: :param audio:Audio file to send.
:param data: :param duration:Duration of the audio in seconds
:param reply_to_message_id: :param performer:Performer
:param title:Track name
:param reply_to_message_id:If the message is a reply, ID of the original messag
:param reply_markup: :param reply_markup:
:return: API reply. :return: Message
""" """
return types.Message.de_json( return types.Message.de_json(
apihelper.send_audio(self.token, chat_id, audio,duration,performer,title, reply_to_message_id, reply_markup)) apihelper.send_audio(self.token, chat_id, audio,duration,performer,title, reply_to_message_id, reply_markup))
def send_voice(self, chat_id, voice, duration=None, reply_to_message_id=None, reply_markup=None): def send_voice(self, chat_id, voice, duration=None, reply_to_message_id=None, reply_markup=None):
"""
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.
:param chat_id:Unique identifier for the message recipient.
:param voice:
:param duration:Duration of sent audio in seconds
:param reply_to_message_id:
:param reply_markup:
:return: Message
"""
return types.Message.de_json( return types.Message.de_json(
apihelper.send_voice(self.token, chat_id, voice, duration, reply_to_message_id,reply_markup)) apihelper.send_voice(self.token, chat_id, voice, duration, reply_to_message_id,reply_markup))