我有一个 web api,它为我提供了人员列表。
这是列表,在邮递员中请求:
在我的机器人中,我想在一条消息中向用户显示此列表。
当我使用 foreach
时,它会为每个人发送一条消息。
这是机器人作曲家:
这是结果:
下图是我所期望的:(硬编码)
我怎样才能在作曲家中做到这一点?
谢谢。
答案 0 :(得分:1)
在输出模板中使用类似的东西(这是一个订单,但在概念上是相同的):
用于格式化每个项目的模板:
# orderItem(x)
- ```
- ${x.name} ${x.qty}
```
然后是订单模板:
# OrderDetails
- ```
ORDER: **${dialog.order.number}**
${join(select(dialog.order.items, x => orderItem(x)), '\n')}
```