Filtering Messages
By filtering messages, we can get messages that only match certain criteria:
with the
includingTags
andexcludingTags
parameters you can filter messages based on the tags set (or not set) in each messagewith the
parentId
parameter you can filter messages according to their relationship:if no
parentId
is passed, any message will matchif null
parentId
is passed, search for all messages without a parentif a non-null
parentId
is passed: query for all messages with the parentId as parent
with the
type
parameter you can filter messages according to their typeif no
type
is passed, any message will matchif an
AmityMessage.DataType
is passed, query for all messages with the specific typeAmityMessage.DataType.TEXT
for text messagesAmityMessage.DataType.IMAGE
for image messagesAmityMessage.DataType.FILE
for file messagesAmityMessage.DataType.AUDIO
for audio messagesAmityMessage.DataType.VIDEO
for video messagesAmityMessage.DataType.CUSTOM
for custom messages
In case, you want to fetch only an individual message from a channel, you can use the getMessage()
method:
Last updated