Skip to content

Commit 9b17220

Browse files
asus007charles_moulhaud
authored and
Morgan Diverrez
committed
#1682 whatsAppCloudTextParameterTemplate - fix problem with spanish (#1683)
* #1682 whatsAppCloudTextParameterTemplate - fix problem with spanish * #1682 whatsAppCloudTextParameterTemplate - use ParameterType in parameter instead of charSequence * #1682 whatsAppCloudTextParameterTemplate - use ParameterType in parameter instead of charSequence + add deprecated method --------- Co-authored-by: charles_moulhaud <charles_moulhaud@connect-tech.sncf>
1 parent 27c7bad commit 9b17220

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

bot/connector-whatsapp-cloud/src/main/kotlin/WhatsAppCloudBuilder.kt

+10-1
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,20 @@ fun <T : Bus<T>> T.whatsAppCloudBodyTemplate(
324324
parameters = parameters
325325
)
326326

327+
@Deprecated("use whatsAppCloudTextParameterTemplate(typeParameter: ParameterType,textButton: CharSequence?) instead")
327328
fun <T : Bus<T>> T.whatsAppCloudTextParameterTemplate(
328329
typeParameter: CharSequence?,
329330
textButton: CharSequence?
330331
): TextParameter = TextParameter(
331-
type = ParameterType.valueOf(translate(typeParameter).toString()),
332+
type = ParameterType.valueOf((typeParameter).toString()),
333+
text = translate(textButton).toString(),
334+
)
335+
336+
fun <T : Bus<T>> T.whatsAppCloudTextParameterTemplate(
337+
typeParameter: ParameterType,
338+
textButton: CharSequence?
339+
): TextParameter = TextParameter(
340+
type = typeParameter,
332341
text = translate(textButton).toString(),
333342
)
334343

0 commit comments

Comments
 (0)