-
Notifications
You must be signed in to change notification settings - Fork 29
searchChatMessages
Sahri Riza Umami edited this page Mar 14, 2017
·
4 revisions
Searches for messages with given words in the chat.
searchChatMessages(chat_id, query, from_message_id, limit, filter)
Returns result in reverse chronological order, i. e. in order of decreasimg message_id.
Doesn't work in secret chats.
Option | Description |
---|---|
chat_id |
Chat identifier to search in. |
query |
Query to search for |
from_message_id |
Identifier of the message from which we need a history, you can use 0 to get results from beginning. |
limit |
Maximum number of messages to be returned, can't be greater than 100. |
filter |
Filter for content of searched messages. The filters are Empty , Animation , Audio , Document , Photo , Video , Voice , PhotoAndVideo , Url , and ChatPhoto . |
-
Return all found messages.
searchChatMessages(1234567890, 'merbot', 0, 17, 'Empty')
-
Return only animation messages.
searchChatMessages(1234567890, 'tzuyu', 0, 17, 'Animation')
-
Return only audio messages.
searchChatMessages(1234567890, 'leessang', 0, 17, 'Audio')
-
Return only document messages.
searchChatMessages(1234567890, 'dummies', 0, 17, 'Document')
-
Return only photo messages.
searchChatMessages(1234567890, 't520', 0, 17, 'Photo')
-
Return only video messages.
searchChatMessages(1234567890, 'turbo', 0, 17, 'Video')
-
Return only voice messages.
searchChatMessages(1234567890, 'anu', 0, 17, 'Voice')
-
Return only photo and video messages.
searchChatMessages(1234567890, 'gunung', 0, 17, 'PhotoAndVideo')
-
Return only messages containing url.
searchChatMessages(1234567890, 'kaskus', 0, 17, 'Url')
-
Return only messages containing chat photos.
searchChatMessages(1234567890, 'saru', 0, 17, 'Photo')
Test script
Frequently Asked Questions
The Functions
- getAuthState
- setAuthPhoneNumber
- resendAuthCode
- checkAuthCode
- checkAuthPassword
- requestAuthPasswordRecovery
- recoverAuthPassword
- resetAuth
- checkAuthBotToken
- getPasswordState
- setPassword
- getRecoveryEmail
- setRecoveryEmail
- requestPasswordRecovery
- recoverPassword
- getMe
- getUser
- getUserFull
- getGroup
- getGroupFull
- getChannel
- getChannelFull
- getSecretChat
- getChat
- getMessage
- getMessages
- getFile
- getFilePersistent
- getChats
- searchPublicChat
- searchPublicChats
- searchChats
- addRecentlyFoundChat
- deleteRecentlyFoundChat
- deleteRecentlyFoundChats
- getCommonChats
- getChatHistory
- deleteChatHistory
- searchChatMessages
- searchMessages
- sendBotStartMessage
- sendInlineQueryResultMessage
- forwardMessages
- sendChatSetTtlMessage
- deleteMessages
- deleteMessagesFromUser
- editMessageText
- editMessageCaption
- editMessageReplyMarkup
- editInlineMessageText
- editInlineMessageCaption
- editInlineMessageReplyMarkup
- getInlineQueryResults
- answerInlineQuery
- getCallbackQueryAnswer
- answerCallbackQuery
- setGameScore
- setInlineGameScore
- getGameHighScores
- getInlineGameHighScores
- deleteChatReplyMarkup
- sendChatAction
- sendChatScreenshotTakenNotification
- openChat
- closeChat
- viewMessages
- openMessageContent
- createPrivateChat
- createGroupChat
- createChannelChat
- createSecretChat
- createNewGroupChat
- createNewChannelChat
- createNewSecretChat
- migrateGroupChatToChannelChat
- changeChatTitle
- changeChatPhoto
- changeChatDraftMessage
- addChatMember
- addChatMembers
- changeChatMemberStatus
- getChatMember
- downloadFile
- cancelDownloadFile
- setFileGenerationProgress
- finishFileGeneration
- exportChatInviteLink
- checkChatInviteLink
- importChatInviteLink
- blockUser
- unblockUser
- getBlockedUsers
- importContacts
- searchContacts
- deleteContacts
- getUserProfilePhotos
- getStickers
- getStickerSets
- getArchivedStickerSets
- getTrendingStickerSets
- getAttachedStickerSets
- getStickerSet
- searchStickerSet
- updateStickerSet
- viewTrendingStickerSets
- reorderStickerSets
- getRecentStickers
- addRecentSticker
- deleteRecentSticker
- clearRecentStickers
- getStickerEmojis
- getSavedAnimations
- addSavedAnimation
- deleteSavedAnimation
- getRecentInlineBots
- getWebPagePreview
- getNotificationSettings
- setNotificationSettings
- resetAllNotificationSettings
- setProfilePhoto
- deleteProfilePhoto
- changeName
- changeAbout
- changeUsername
- changePhoneNumber
- resendChangePhoneNumberCode
- checkChangePhoneNumberCode
- getActiveSessions
- terminateSession
- terminateAllOtherSessions
- toggleGroupEditors
- changeChannelUsername
- toggleChannelInvites
- toggleChannelSignMessages
- changeChannelAbout
- pinChannelMessage
- unpinChannelMessage
- reportChannelSpam
- getChannelMembers
- deleteChannel
- getCreatedPublicChannels
- closeSecretChat
- getSupportUser
- getWallpapers
- registerDevice
- getDeviceTokens
- setPrivacy
- getPrivacy
- getOption
- setOption
- changeAccountTtl
- getAccountTtl
- deleteAccount
- getChatReportSpamState
- changeChatReportSpamState
- setBotUpdatesStatus
- setAlarm
- sendText
- sendAnimation
- sendAudio
- sendDocument
- sendPhoto
- sendSticker
- sendVideo
- sendVoice
- sendLocation
- sendVenue
- sendContact
- sendGame
- sendForwarded