-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbase-config.yaml
72 lines (64 loc) · 2.54 KB
/
base-config.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# The room ID of the control room.
control_room: null
# If a new user joins the room within this many seconds of the previous
# user joining, the bot won't send another user-welcome message.
new_user_cooldown: 10
# If a new message is sent in a case room with no agents within this many
# seconds of the previous message, the bot won't re-send the notification
# to the control room.
new_message_cooldown: 60
# Content to prepend to all message templates.
template_prepend: |
{% macro unmention(text) -%}
{{ text|join("\u2063") }}
{%- endmacro %}
{% macro pill(user_id, displayname=None) -%}
[{{ unmention(displayname or user_id) }}](https://matrix.to/#/{{ user_id }})
{%- endmacro %}
{% macro case_text(case, is_new=False) -%}
{% if is_new -%}
New case
{%- else -%}
Case
{%- endif -%}
{%- if case.user_id -%}
{% if case.room_name and case.room_name != case.displayname -%}
: **{{ case.room_name }}** (from {{ pill(case.user_id, case.displayname) }})
{%- else -%}
{# space adder #} from {{ pill(case.user_id, case.displayname) }}
{%- endif %}
{%- else -%}
: **{{ case.room_name }}** ({{ pill(case.id, case.room_name) }})
{%- endif %}
{%- endmacro %}
# Message templates.
templates:
welcome: |-
Thank you for contacting us. A support agent will be with you shortly.
Please note that chat history is logged. By sending messages, you are
consenting to be recorded.
new_user: |-
Hello {{ pill(evt.state_key) }}, please note that chat history is
logged. By sending messages, you are consenting to be recorded.
invite_error: Failed to handle invite from {{ pill(evt.sender) }}.
new_case: |-
{{ case_text(case, is_new=True) }}.
👍️ this message to claim the case.
case_message: |-
{{ case_text(case) }} has new message, but no agents are in
the room.
👍️ this message to claim the case.
case_accepted: |-
{{ case_text(case) }} accepted by {{ pill(evt.sender, sender_displayname) }}.
case_status: |-
{{ case_text(case) }}.
{% if agents %}
Agents in room:
{% for agent, profile in agents.items() -%}
- {{ pill(agent, profile.displayname) }}
{% endfor %}
{% else -%}
No agents in room.
{%- endif %}
case_closed: |-
Case from {{ pill(case.user_id, case.displayname) }} closed: user left the room.