Filtering Messages

By filtering messages, we can get messages that only match certain criteria:

  • with the includingTags and excludingTags parameters you can filter messages based on the tags set (or not set) in each message

  • with the parentId parameter you can filter messages according to their relationship:

    • if no parentId is passed, any message will match

    • if null parentId is passed, search for all messages without a parent

    • if 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 type

    • if no type is passed, any message will match

    • if an AmityMessage.DataType is passed, query for all messages with the specific type

      • AmityMessage.DataType.TEXT for text messages

      • AmityMessage.DataType.IMAGE for image messages

      • AmityMessage.DataType.FILE for file messages

      • AmityMessage.DataType.AUDIO for audio messages

      • AmityMessage.DataType.VIDEO for video messages

      • AmityMessage.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