Repository navigation
Expand file tree
/
Copy pathjobs.example.yaml
More file actions
117 lines (108 loc) · 3.1 KB
/
Copy pathjobs.example.yaml
File metadata and controls
117 lines (108 loc) · 3.1 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Gateway jobs configuration for tlgr.
#
# Each job is an event-driven pipeline:
# event -> filters -> processors -> actions
#
# See tlgr/gateway/README.md for the full reference.
#
# Every action runs through tlgr's op layer and is paced per account and
# action kind. The optional `pacing:` block changes the pace; the values
# below are the defaults.
pacing:
main:
react: {every: 4s, per_hour: 300}
read: {every: 2s}
view: {every: 2s}
forward: {every: 1.5s}
reply: {every: 1.5s}
expire: {react: 24h, view: 24h, reply: 24h}
jobs:
# Acknowledge DMs from contacts the way a person would: read after a
# while, listen to voice notes, sometimes react, and answer a new chat.
- name: dm-ack
account: main
filters: {chat_type: private, sender_is_contact: true}
presence: {mode: session, quiet_hours: "01:00-08:00"}
on_takeover: cancel # cancel | cancel_read | ignore
actions:
- read: {delay: 10-90s} # + reading time
- view: {delay: 15-120s} # voice/round notes
- react:
emoji: ["👍", "❤", "🔥"] # random; or {"👍": 3, "🔥": 1}
percent: 60
delay: 30-300s
- reply:
text: "Got it, will answer soon"
filters: {chat_is_new: true}
typing: true # default for reply
delay: 1-3m
# Try a rule without touching Telegram: it is scheduled, logged and
# counted, never sent.
- name: dry-run-example
account: main
dry_run: true
filters: {chat_type: private}
actions:
- react: "👀"
# Auto-reply to all private messages
- name: private-bot
account: main
filters:
chat_type: private
actions:
- reply: "Away until Monday. Will respond when I'm back."
# Forward from one channel to another
- name: news-forward
account: main
filters:
chat_id: "@source_channel"
types: [text, photo]
contains: [breaking]
actions:
- forward:
to: ["@my_archive", "@friend"]
drop_author: true
# Forward with per-action processors
- name: cleaned-forward
account: main
filters:
chat_id: "@raw_feed"
actions:
- forward:
to: ["@clean_feed"]
processors:
- strip_formatting
- type: regex
pattern: "sponsor"
replacement: ""
flags: i
- forward:
to: ["@archive"]
# Complex filter composition (AND / OR / NOT)
- name: smart-reply
account: main
filters:
chat_type: private
any_of:
- contains: [hello, hi]
- from_users: [12345]
none_of:
- contains: [spam, ad]
actions:
- reply: "Thanks for reaching out!"
# Time-based auto-reply
- name: night-mode
account: main
filters:
chat_type: private
time_of_day: "23:00-07:00"
actions:
- reply: "I'm sleeping. Will reply tomorrow."
# Disabled job (won't run)
- name: disabled-example
account: main
enabled: false
filters:
chat_type: private
actions:
- reply: "This job is disabled."