-
Notifications
You must be signed in to change notification settings - Fork 21
forwardMessages
Sahri Riza Umami edited this page Jul 2, 2018
·
3 revisions
Forwards previously sent messages.
Returns the forwarded messages in the same order as the message identifiers passed in message_ids
.
If a message can't be forwarded, null will be returned instead of the message.
forwardMessages(chat_id, from_chat_id, message_ids, disable_notification, from_background, as_album, callback, data)
Field | Type | Description |
---|---|---|
chat_id |
int53 | Identifier of a chat to forward messages. |
from_chat_id |
int53 | Identifier of the chat from which to forward messages. |
message_ids |
vector<int53> | Identifiers of the messages to forward. |
disable_notification |
Bool | Pass true to disable notification for the message, doesn't work if messages are forwarded to a secret chat. |
from_background |
Bool | Pass true if the message is sent from the background. |
as_album |
Bool | True, if the messages should be grouped into an album after forwarding. For this to work, no more than 10 messages may be forwarded, and all of them must be photo or video messages |
-
Forwards messages
16446914560
,16445865984
and16444817408
from chat1234567890
to chat1234567890
.forwardMessages(1234567890, 1234567890, {[0]=16446914560, 16445865984, 16444817408})
Response:
{ ["@type"] = "messages", messages = { { ["@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"] = "messageText", text = { ["@type"] = "formattedText", entities = {}, text = "TIGA" } }, date = 1530515844, edit_date = 0, forward_info = { ["@type"] = "messageForwardedFromUser", date = 1530515527, forwarded_from_chat_id = 0, forwarded_from_message_id = 0, sender_user_id = 133780085 }, id = 16453206025, is_channel_post = false, is_outgoing = true, media_album_id = "0", reply_to_message_id = 0, sender_user_id = 133780085, sending_state = { ["@type"] = "messageSendingStatePending" }, ttl = 0, ttl_expires_in = 0, via_bot_user_id = 0, views = 0 }, { ["@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"] = "messageText", text = { ["@type"] = "formattedText", entities = {}, text = "DUA" } }, date = 1530515844, edit_date = 0, forward_info = { ["@type"] = "messageForwardedFromUser", date = 1530515523, forwarded_from_chat_id = 0, forwarded_from_message_id = 0, sender_user_id = 133780085 }, id = 16453206033, is_channel_post = false, is_outgoing = true, media_album_id = "0", reply_to_message_id = 0, sender_user_id = 133780085, sending_state = { ["@type"] = "messageSendingStatePending" }, ttl = 0, ttl_expires_in = 0, via_bot_user_id = 0, views = 0 }, { ["@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"] = "messageText", text = { ["@type"] = "formattedText", entities = {}, text = "SATU" } }, date = 1530515844, edit_date = 0, forward_info = { ["@type"] = "messageForwardedFromUser", date = 1530515519, forwarded_from_chat_id = 0, forwarded_from_message_id = 0, sender_user_id = 133780085 }, id = 16453206041, is_channel_post = false, is_outgoing = true, media_album_id = "0", reply_to_message_id = 0, sender_user_id = 133780085, sending_state = { ["@type"] = "messageSendingStatePending" }, ttl = 0, ttl_expires_in = 0, via_bot_user_id = 0, views = 0 } }, total_count = 3 }
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