fix: fix message content type detection

This commit is contained in:
Cristiano Cruz
2023-11-16 16:18:13 -03:00
committed by GitHub
parent e24947e55a
commit a07922b136

View File

@@ -645,7 +645,7 @@ export const generateWAMessage = async(
export const getContentType = (content: WAProto.IMessage | undefined) => {
if(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
}
}