2
0

🧑‍💻 (whatsapp) Option to modify the default interactive split message number (#1296)

When using the whatsapp oficial api or another that use the same schema,
with env we can modify the number of groups that the interactive group
will be split.

---------

Co-authored-by: Baptiste Arnaud <baptiste.arnaud95@gmail.com>
Co-authored-by: Baptiste Arnaud <contact@baptiste-arnaud.fr>
This commit is contained in:
thercd
2024-03-07 05:05:08 -03:00
committed by GitHub
parent 712a56502f
commit df209a8e9d
3 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import { InputBlockType } from '@typebot.io/schemas/features/blocks/inputs/const
import { defaultPictureChoiceOptions } from '@typebot.io/schemas/features/blocks/inputs/pictureChoice/constants'
import { defaultChoiceInputOptions } from '@typebot.io/schemas/features/blocks/inputs/choice/constants'
import { convertRichTextToMarkdown } from '@typebot.io/lib/markdown/convertRichTextToMarkdown'
import { env } from '@typebot.io/env'
export const convertInputToWhatsAppMessages = (
input: NonNullable<ContinueChatResponse['input']>,
@ -110,7 +111,7 @@ export const convertInputToWhatsAppMessages = (
]
const items = groupArrayByArraySize(
input.items.filter((item) => isDefined(item.content)),
3
env.WHATSAPP_INTERACTIVE_GROUP_SIZE
) as ButtonItem[][]
return items.map((items, idx) => ({
type: 'interactive',