-
Notifications
You must be signed in to change notification settings - Fork 21
sendAudio
Sahri Riza Umami edited this page Jun 12, 2018
·
5 revisions
Sends an audio message.
sendAudio(chat_id, reply_to_message_id, audio, caption, parse_mode, duration, title, performer, thumbnail, thumb_width, thumb_height, disable_notification, from_background, reply_markup, callback, data)
Field | Type | Description |
---|---|---|
chat_id |
int53 | Chat to send message. |
reply_to_message_id |
int53 | Identifier of a message to reply to. |
audio |
inputFile | Audio file to be sent. The file can be defined by its unique ids, remote ids, local path or generated by client. |
caption |
string | Audio caption; 0-200 characters. |
parse_mode |
string | Text parse mode. |
duration |
int32 | Duration of the audio, in seconds; may be replaced by the server. |
title |
string | Title of the audio; 0-64 characters; may be replaced by the server. |
performer |
string | Performer of the audio; 0-64 characters, may be replaced by the server. |
album_cover_thumbnail |
inputThumb | Thumbnail of the cover for the album, if available. |
disable_notification |
Bool | Pass true, to disable notification about the message, doesn't works in secret chats |
from_background |
Bool | Pass true, if the message is sent from background. |
reply_markup |
ReplyMarkup | Bots only. Markup for replying to message. |
-
Send an audio message by its unique ids which is
212
, into chat1234567890
. Add "Test" string in bold as its caption.sendAudio(1234567890, msg.id, 212, "<b>Test</b>", 'html')
Response:
{ ["@type"] = "message", author_signature = "", can_be_deleted_for_all_users = true, can_be_deleted_only_for_self = false, can_be_edited = false, can_be_forwarded = true, chat_id = "1234567890", contains_unread_mention = false, content = { ["@type"] = "messageAudio", audio = { ["@type"] = "audio", audio = { ["@type"] = "file", expected_size = 9782617, id = 212, ["local"] = { ["@type"] = "localFile", can_be_deleted = false, can_be_downloaded = true, downloaded_prefix_size = 0, downloaded_size = 0, is_downloading_active = false, is_downloading_completed = false, path = "" }, remote = { ["@type"] = "remoteFile", id = "CQADBQADCgAD38dgVgaMSxP5WQ7GAg", is_uploading_active = false, is_uploading_completed = true, uploaded_size = 9782617 }, size = 9782617 }, duration = 244, file_name = "061 - Bee Gees - How Deep Is Your Love .mp3", mime_type = "audio/mpeg", performer = "Bee Gees", title = "How Deep Is Your Love" }, caption = { ["@type"] = "formattedText", entities = { { ["@type"] = "textEntity", length = 4, offset = 0, type = { ["@type"] = "textEntityTypeBold" } } }, text = "Test" } }, date = 1528824598, edit_date = 0, id = "15959326729", is_channel_post = false, is_outgoing = true, media_album_id = "0", reply_to_message_id = "15959326720", sender_user_id = 434567051, sending_state = { ["@type"] = "messageSendingStatePending" }, ttl = 0, ttl_expires_in = 0, via_bot_user_id = 0, views = 0 }
Frequently Asked Questions
The Functions
- getAuthorizationState
- setTdlibParameters
- checkDatabaseEncryptionKey
- setAuthenticationPhoneNumber
- resendAuthenticationCode
- checkAuthenticationCode
- checkAuthenticationPassword
- requestAuthenticationPasswordRecovery
- recoverAuthenticationPassword
- checkAuthenticationBotToken
- logOut
- close
- destroy
- setDatabaseEncryptionKey
- getPasswordState
- setPassword
- getRecoveryEmailAddress
- setRecoveryEmailAddress
- requestPasswordRecovery
- recoverPassword
- createTemporaryPassword
- getTemporaryPasswordState
- processDcUpdate
- getMe
- getUser
- getUserFullInfo
- getBasicGroup
- getBasicGroupFullInfo
- getSupergroup
- getSupergroupFullInfo
- getSecretChat
- getChat
- getMessage
- getRepliedMessage
- getChatPinnedMessage
- getMessages
- getFile
- getRemoteFile
- getChats
- searchPublicChat
- searchPublicChats
- searchChats
- searchChatsOnServer
- getTopChats
- removeTopChat
- addRecentlyFoundChat
- removeRecentlyFoundChat
- clearRecentlyFoundChats
- checkChatUsername
- getCreatedPublicChats
- getGroupsInCommon
- getChatHistory
- deleteChatHistory
- searchChatMessages
- searchMessages
- searchSecretMessages
- searchCallMessages
- searchChatRecentLocationMessages
- getActiveLiveLocationMessages
- getChatMessageByDate
- getPublicMessageLink
- sendMessage
- sendMessageAlbum
- sendBotStartMessage
- sendInlineQueryResultMessage
- forwardMessages
- sendChatSetTtlMessage
- sendChatScreenshotTakenNotification
- deleteMessages
- deleteChatMessagesFromUser
- editMessageText
- editMessageLiveLocation
- editMessageCaption
- editMessageReplyMarkup
- editInlineMessageText
- editInlineMessageLiveLocation
- editInlineMessageCaption
- editInlineMessageReplyMarkup
- getTextEntities
- parseTextEntities
- getFileMimeType
- getFileExtension
- getInlineQueryResults
- answerInlineQuery
- getCallbackQueryAnswer
- answerCallbackQuery
- answerShippingQuery
- answerPreCheckoutQuery
- setGameScore
- setInlineGameScore
- getGameHighScores
- getInlineGameHighScores
- deleteChatReplyMarkup
- sendChatAction
- openChat
- closeChat
- viewMessages
- openMessageContent
- readAllChatMentions
- createPrivateChat
- createBasicGroupChat
- createSupergroupChat
- createSecretChat
- createNewBasicGroupChat
- createNewSupergroupChat
- createNewSecretChat
- upgradeBasicGroupChatToSupergroupChat
- setChatTitle
- setChatPhoto
- setChatDraftMessage
- toggleChatIsPinned
- setChatClientData
- addChatMember
- addChatMembers
- setChatMemberStatus
- getChatMember
- searchChatMembers
- getChatAdministrators
- setPinnedChats
- downloadFile
- cancelDownloadFile
- uploadFile
- cancelUploadFile
- setFileGenerationProgress
- finishFileGeneration
- deleteFile
- generateChatInviteLink
- checkChatInviteLink
- joinChatByInviteLink
- createCall
- acceptCall
- discardCall
- sendCallRating
- sendCallDebugInformation
- blockUser
- unblockUser
- getBlockedUsers
- importContacts
- searchContacts
- removeContacts
- getImportedContactCount
- changeImportedContacts
- clearImportedContacts
- getUserProfilePhotos
- getStickers
- searchStickers
- getInstalledStickerSets
- getArchivedStickerSets
- getTrendingStickerSets
- getAttachedStickerSets
- getStickerSet
- searchStickerSet
- searchInstalledStickerSets
- searchStickerSets
- changeStickerSet
- viewTrendingStickerSets
- reorderInstalledStickerSets
- getRecentStickers
- addRecentSticker
- removeRecentSticker
- clearRecentStickers
- getFavoriteStickers
- addFavoriteSticker
- removeFavoriteSticker
- getStickerEmojis
- getSavedAnimations
- addSavedAnimation
- removeSavedAnimation
- getRecentInlineBots
- searchHashtags
- removeRecentHashtag
- getWebPagePreview
- getWebPageInstantView
- getNotificationSettings
- setNotificationSettings
- setNotificationSettings
- resetAllNotificationSettings
- setProfilePhoto
- deleteProfilePhoto
- setName
- setBio
- setUsername
- changePhoneNumber
- resendChangePhoneNumberCode
- checkChangePhoneNumberCode
- getActiveSessions
- terminateSession
- terminateAllOtherSessions
- getConnectedWebsites
- disconnectWebsite
- disconnectAllWebsites
- toggleBasicGroupAdministrators
- setSupergroupUsername
- setSupergroupStickerSet
- toggleSupergroupInvites
- toggleSupergroupSignMessages
- toggleSupergroupIsAllHistoryAvailable
- setSupergroupDescription
- pinSupergroupMessage
- unpinSupergroupMessage
- reportSupergroupSpam
- getSupergroupMembers
- deleteSupergroup
- closeSecretChat
- getChatEventLog
- getPaymentForm
- validateOrderInfo
- sendPaymentForm
- getPaymentReceipt
- getSavedOrderInfo
- deleteSavedOrderInfo
- deleteSavedCredentials
- getSupportUser
- getWallpapers
- registerDevice
- getRecentlyVisitedTMeUrls
- setUserPrivacySettingRules
- getUserPrivacySettingRules
- getOption
- setOption
- setAccountTtl
- getAccountTtl
- deleteAccount
- getChatReportSpamState
- changeChatReportSpamState
- reportChat
- getStorageStatistics
- getStorageStatisticsFast
- optimizeStorage
- setNetworkType
- getNetworkStatistics
- addNetworkStatistics
- resetNetworkStatistics
- setBotUpdatesStatus
- uploadStickerFile
- createNewStickerSet
- addStickerToSet
- setStickerPositionInSet
- removeStickerFromSet
- sendCustomRequest
- answerCustomQuery
- setAlarm
- getCountryCode
- getInviteText
- getTermsOfService
- setProxy
- getProxy
- testCallEmpty
- testCallString
- testCallBytes
- testCallVectorInt
- testCallVectorIntObject
- testCallVectorString
- testCallVectorStringObject
- testSquareInt
- testNetwork
- testGetDifference
- testUseUpdate
- testUseError
- sendText
- sendAnimation
- sendAudio
- sendDocument
- sendPhoto
- sendSticker
- sendVideo
- sendVideoNote
- sendVoiceNote
- sendLocation
- sendVenue
- sendContact
- sendGame
- sendInvoice
- sendForwarded