# 属性设置插件

有时，我们需要给用户展示变量信息。比如，在预定酒店时，用户选择了2019-3-15入住，我们可以让Bot回复“You will check in on 2019-3-15”。这时固定文本无法满足，我们需要在文本中加入参数。

在内容管理中，如需向用户展示变量，在参数名前后加上双大括号即可。例如上面的句子，实际编辑为 “You will check in on {{check\_in\_date}}”。

除了系统预置参数{{first\_name}}、{{last\_name}}外，你可以在属性设置插件中填写任意以“小写字母+下划线”命名的自定义变量，用以在卡片中展示、搭配其他的高级插件使用。下面通过2个场景，详细介绍属性设置插件的应用。

### 订餐

![](/files/-Lb6y4wZxslA6hTQmXvl)

对话中，Bot询问用户是否需要上次的“Ham & Cheese”。

这个过程的实现方式是，在用户选餐后，使用属性设置插件将“Ham & Cheess”保存到参数“sandwiches”中；并在用户再次点餐时，使用{{sandwiches}}展示该内容。

![用户选餐后，将Ham & Cheese保存至参数sandwiches](/files/-Lb6z45Sn5_NDRUVg2pZ)

![再次触发流程时，{{sandwiches}}即会展示为对应参数](/files/-Lb6zPpNJbJHG95qR9s7)

### 订阅新闻

![](/files/-Lb76yjPAMBXPkQYl0uI)

对话中，Bot向用户提供了订阅按钮。用户两次点击同个按钮时，Bot能根据当前订阅状态回复不同内容。

后台配置时，我们命名一个参数用以判断用户的订阅状态，比如"subcription\_status"（也可以使用其他参数名，方便Bot管理员理解即可），并用“1”表示已订阅；“0”表示未订阅。\
当用户订阅成功后，使用属性设置插件，将"subcription\_status"设置为“1”；

![](/files/-Lb7BKjVMCoJ7yoB9iOg)

当用户再次点击时，使用条件跳转插件判断用户是否已订阅（即判断subcription\_status是否为1），进而回复“订阅成功”或“已经订阅”的提示消息。

![](/files/-Lb7BkCXfKGiI0AwDxjk)

![](/files/-Lb7BxA7743-1WPpsehF)

![](/files/-Lb7FCMP0ozfQSCHyxym)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bothub.gitbook.io/project/advanced-tool/plugin/shu-xing-she-zhi-cha-jian.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
