Coder Social home page Coder Social logo

Comments (5)

ekasetiawans avatar ekasetiawans commented on July 17, 2024 1

So we need to check which the correct message type right?

from whatsmeow.

JustSoursop avatar JustSoursop commented on July 17, 2024

It's kinda hard to figure it out since you didn't provide more information about your case.

from whatsmeow.

ekasetiawans avatar ekasetiawans commented on July 17, 2024

I just using simpel example whatsmeow in godoc, the conversation message has empty string

from whatsmeow.

JustSoursop avatar JustSoursop commented on July 17, 2024

IINW, there's 2 type of text message in WhatsApp proto,
Conversation & ExtendedTextMessage

Conversation commonly used in regular chat message that doesn't use Disappearing timer and
then ExtendedTextMessage is a rich text message that can containText, Link preview, Ads, and other properties like quoting, forwarding, Expiration (for disappearing timer) .

reff :
https://pkg.go.dev/go.mau.fi/[email protected]/binary/proto#Message

from whatsmeow.

lucasvmx avatar lucasvmx commented on July 17, 2024

So we need to check which the correct message type right?

Right.

You can use this function to check:

func hasTextMessage(msg *proto.Message) bool {
	extendedMsg := msg.GetExtendedTextMessage()

	return len(msg.GetConversation()) > 0 ||
		len(extendedMsg.GetContextInfo().GetQuotedMessage().GetConversation()) > 0 ||
		len(extendedMsg.GetText()) > 0
}

from whatsmeow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.