mirror of
https://github.com/baptisteArno/typebot.io.git
synced 2026-06-19 21:04:33 +08:00
🐛 Add support for WhatsApp sticker incoming messages
This commit is contained in:
parent
decc19abc9
commit
9afbf62f35
@ -200,12 +200,14 @@ const convertWhatsAppMessageToTypebotMessage = async ({
|
||||
case "document":
|
||||
case "audio":
|
||||
case "video":
|
||||
case "sticker":
|
||||
case "image": {
|
||||
let mediaId: string | undefined;
|
||||
if (message.type === "video") mediaId = message.video.id;
|
||||
if (message.type === "image") mediaId = message.image.id;
|
||||
if (message.type === "audio") mediaId = message.audio.id;
|
||||
if (message.type === "document") mediaId = message.document.id;
|
||||
if (message.type === "sticker") mediaId = message.sticker.id;
|
||||
if (!mediaId) return;
|
||||
const fileVisibility =
|
||||
block?.type === InputBlockType.TEXT &&
|
||||
|
||||
@ -165,6 +165,12 @@ export const incomingMessageSchema = z.discriminatedUnion("type", [
|
||||
emoji: z.string().optional(),
|
||||
}),
|
||||
}),
|
||||
sharedIncomingMessageFieldsSchema.extend({
|
||||
type: z.literal("sticker"),
|
||||
sticker: z.object({
|
||||
id: z.string(),
|
||||
}),
|
||||
}),
|
||||
sharedIncomingMessageFieldsSchema.extend({
|
||||
type: z.literal("unsupported"),
|
||||
}),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user