mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: fix message content type detection
This commit is contained in:
@@ -645,7 +645,7 @@ export const generateWAMessage = async(
|
|||||||
export const getContentType = (content: WAProto.IMessage | undefined) => {
|
export const getContentType = (content: WAProto.IMessage | undefined) => {
|
||||||
if(content) {
|
if(content) {
|
||||||
const keys = Object.keys(content)
|
const keys = Object.keys(content)
|
||||||
const key = keys.find(k => (k === 'conversation' || k.endsWith('Message')) && k !== 'senderKeyDistributionMessage')
|
const key = keys.find(k => (k === 'conversation' || k.includes('Message')) && k !== 'senderKeyDistributionMessage')
|
||||||
return key as keyof typeof content
|
return key as keyof typeof content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user