Auties00 / Cobalt

Standalone unofficial fully-featured Whatsapp Web and Mobile API for Java and Kotlin
MIT License
634 stars 185 forks source link

How learn what's type of HistorySyncMessage? #301

Closed savox-326 closed 1 year ago

savox-326 commented 1 year ago

At 3.2.3 version I just used cast message to ImageMessage, TextMessage and so on. But now I don't know how learn what is type of message pulled from chat because media messages doesn't implements or extends MessageInfo

Auties00 commented 1 year ago

At 3.2.3 version I just used cast message to ImageMessage, TextMessage and so on. But now I don't know how learn what is type of message pulled from chat because media messages doesn't implements or extends MessageInfo

You can just access the inner messageInfo by using .message()

savox-326 commented 1 year ago

@Auties00 I did that, and what to do farther? I got MessageInfo but that still isn't used for VideoMessage, StickerMessage... I just want handle message type, it is essential for me, I didn't find methods for that (after .message() ). Thanks

Auties00 commented 1 year ago

@Auties00 I did that, and what to do farther? I got MessageInfo but that still isn't use for VideoMessage, StickerMessage... I just want handle message type, it is essential for me, I didn't find methods for that (after .message() ). Thanks

Let's say you have a history sync message: historySyncMessage.message().message(().content() And you'll have the message