Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###########################################################
- ## Automation
- ###########################################################
- automation:
- - id: line_webhook_cmds
- alias: line_webhook_cmds
- description: "Line下指令"
- mode: single
- trigger:
- - platform: webhook
- webhook_id: my_webhook_id #記得更換成自己的webhook_id
- condition: []
- action:
- - choose:
- - alias: "簡易回覆指令"
- conditions:
- - condition: template
- value_template: "{{ trigger.json.events.0.message.text == '測試' }}"
- sequence:
- - service: rest_command.linebot_reply
- data:
- reply_token: "{{ trigger.json.events.0.replyToken }}"
- msg_text: "你好!"
- ###########################################################
- ## Rest command
- ###########################################################
- ## 利用reply token回覆純文字給使用者
- rest_command:
- linebot_reply:
- url: 'https://api.line.me/v2/bot/message/reply'
- method: POST
- content_type: 'application/json'
- headers:
- Authorization: !secret linebot_token_rest
- payload: '{
- "replyToken": "{{ reply_token }}",
- "messages":[
- {
- "type":"text",
- "text":"{{ msg_text }}"
- }
- ]
- }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement