diff --git a/bot/connector-whatsapp-cloud/src/main/kotlin/WhatsAppCloudBuilder.kt b/bot/connector-whatsapp-cloud/src/main/kotlin/WhatsAppCloudBuilder.kt index 2d23c96c31..a6365c73bf 100644 --- a/bot/connector-whatsapp-cloud/src/main/kotlin/WhatsAppCloudBuilder.kt +++ b/bot/connector-whatsapp-cloud/src/main/kotlin/WhatsAppCloudBuilder.kt @@ -324,11 +324,20 @@ fun > T.whatsAppCloudBodyTemplate( parameters = parameters ) +@Deprecated("use whatsAppCloudTextParameterTemplate(typeParameter: ParameterType,textButton: CharSequence?) instead") fun > T.whatsAppCloudTextParameterTemplate( typeParameter: CharSequence?, textButton: CharSequence? ): TextParameter = TextParameter( - type = ParameterType.valueOf(translate(typeParameter).toString()), + type = ParameterType.valueOf((typeParameter).toString()), + text = translate(textButton).toString(), +) + +fun > T.whatsAppCloudTextParameterTemplate( + typeParameter: ParameterType, + textButton: CharSequence? +): TextParameter = TextParameter( + type = typeParameter, text = translate(textButton).toString(), )