-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjarvis.yaml
34 lines (34 loc) · 863 Bytes
/
jarvis.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
- id: '1605444642682'
alias: Jarvis
description: ''
trigger:
- platform: event
event_type: telegram_command
event_data:
command: /help
context: {}
- platform: event
event_type: telegram_command
event_data:
command: /status
context: {}
action:
- service: telegram_bot.send_message
data_template:
message: |-
{% set cmd = trigger.event.data.command %}
{% if cmd == "/status" %}
{% for state in states.switch %}
{{state.name}} ist {{state.state}}
{% endfor %}
{% elif cmd == "/help" %}
/status
/rollo
{% endif %}
target: |-
{% if trigger.event.data.group_id == null %}
{{trigger.event.data.user_id}}
{% else %}
{{trigger.event.data.group_id}}
{% endif %}
mode: single