twilio - 在自动驾驶仪的收集操作中添加新行
问题描述
我问我的机器人用户一系列问题,其中一些要求他们回答李克特式的问题。当我提供答案选项时,将项目放在新行上会很有帮助。
{
"actions": [
{
"collect": {
"name": "q1",
"questions": [
{
"question": "How much does this bother you?\\n\\n1 = not at all\\n2 = somewhat\\n3 = moderately\\n4 = quite a bit",
"name": "q1_score",
"type": "Twilio.NUMBER"
}
],
"on_complete": {
"redirect": "task://question_2"
}
}
}
]
}
理想情况下,这将返回一条短信,上面写着:
How much does this bother you?
1 = not at all
2 = somewhat
3 = moderately
4 = quite a bit
但它实际返回的是:
How much does this bother you?\n\n1 = not at all\n2 = somewhat\n3 = moderately\n4 = quite a bit
我是否转义\
都没关系(即既不\n
也不\\n
返回所需的结果)。尝试使用 URL 编码版本%0a
也不起作用。
提前感谢您提供的任何见解。
解决方案
推荐阅读
- python-3.x - 根据返回写入文件名
- python - 如何获取一个包含值和标题表的 .txt 文件并将其转换为 numpy 2D 数组?
- r - 宽到长和列名到行名
- python - 使用“稀疏分类交叉熵”
- java - Mokito 注释 @Mock,@InjectMocks 不起作用
- python - 如何根据值替换行数据
- unity3d - Unity 3D:什么可能导致旋转小工具偏离游戏对象中心?
- flutter - 使用 onTapLink 时出错:无法分配参数类型'void Function(String, String, String)'
- php - 如果请求来自不同的来源,是否可以拥有会话/cookie?
- java - 试图从索引表中获取数据会产生 -java.lang.NoSuchMethodError: org.hibernate.query.internal.ParameterMetadataImpl