Comments (5)
So we need to check which the correct message type right?
from whatsmeow.
It's kinda hard to figure it out since you didn't provide more information about your case.
from whatsmeow.
I just using simpel example whatsmeow in godoc, the conversation message has empty string
from whatsmeow.
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.
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)
- Connected, but registering device +... β³ Waiting for code...XXXX-XXXX HOT 3
- timeout running - Getting Issue While QR Scan Call Open HOT 5
- Not working when setting DeviceProps_HistorySyncConfig HOT 3
- go 12.1 not support window 7 HOT 1
- Client outdated (405) connect failure (client version: 2.2329.9) HOT 1
- Audio VN (PTT) cant play in iOS HOT 4
- List Message not working HOT 6
- Goroutines use a lot of RAM memory after this error HOT 1
- No new message notification on phone if message received in whatsmeow HOT 11
- Re-request media from phone HOT 1
- Questions about database HOT 3
- I have an account with a 6-segment key, how do I use it to log in to WhatsApp?
- Contact name HOT 1
- get account creation date
- Please update Upload documentation HOT 3
- Not sending sync data HOT 4
- [Client WARN] Failed to parse <meta> node in 774CB66BF4BB7D3336: [didn't find required attribute 'target_id'] HOT 1
- Bug send reply message (in receiver not work) HOT 1
- Whats appropiate media type for files like .docx .xlsx, etc? HOT 2
- Sometime Object Message is Empty HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whatsmeow.