-
Notifications
You must be signed in to change notification settings - Fork 163
/
example.config.js
161 lines (136 loc) · 3.78 KB
/
example.config.js
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// @ts-check
'use strict';
/**
* @typedef { import('./typings/config').Config } Config
* @typedef { import('./typings/config').InlineKeyboard } InlineKeyboard
*/
/*
* Create `config.js` by running `cp example.config.js config.js`
* in the project folder, then edit it.
*
* Config file in JSON format (`config.json`) is also supported.
* For backwards compatibility, and because why not, it needs no extra code.
*/
/**
* Millisecond
* String to be parsed by https://npmjs.com/millisecond,
* or number of milliseconds. Pass 0 to remove immediately.
* @typedef {( number | string )} ms
*/
/**
* @type {Config}
*/
const config = {
/**
* @type {!( number | string | (number|string)[] )}
* ID (number) or username (string) of master,
* the person who can promote and demote admins,
* and add the bot to groups.
*/
master: 123456789,
/**
* @type {!string}
* Telegram Bot token obtained from https://t.me/BotFather.
*/
token: '',
chats: {
/**
* @type {(number | false)}
* Chat to send member (un)ban/(un)warn/report notifications and
* relevant messages to. Pass false to disable this feature.
*/
adminLog: false,
/**
* @type {(number | false)}
* Chat to send member join/leave notifications to.
* Pass false to disable this feature.
*/
presenceLog: false,
/**
* @type {(number | false)}
* Chat to send report notifications to.
* Pass false to disable this feature.
*/
report: false,
/**
* @type {(true | false)}
* Disable whether clicking on `[Report handled]` deletes the
* report chat message.
*/
noReportChatDeletion: false,
},
/**
* @type {( 'all' | 'own' | 'none' )}
* Which messages with commands should be deleted?
* Defaults to 'own' -- don't delete commands meant for other bots.
*/
deleteCommands: 'own',
deleteCustom: {
longerThan: 450, // UTF-16 characters
after: '20 minutes',
},
/**
* @type {(ms | false)} Millisecond
* Timeout before removing join and leave messages.
* [Look at typedef above for details.]
* Pass false to disable this feature.
*/
deleteJoinsAfter: '2 minutes',
/**
* @type {(ms | { auto: (ms | false), manual: (ms | false) } | false)}
* Timeout before removing auto-warn messages.
* [Look at typedef above for details.]
* Pass an object with { auto, manual } for more granular control
* over which messages get deleted
* Pass false to disable this feature.
*/
deleteWarnsAfter: false,
/**
* @type {(ms | false)}
* Timeout before removing ban messages.
* [Look at typedef above for details.]
* Pass false to disable this feature.
*/
deleteBansAfter: false,
/**
* @type {string[]}
* List of blacklisted domains.
* Messages containing blacklisted domains will automatically be warned.
* If the link is shortened, an attempt will be made to resolve it.
* If resolved link is blacklisted, it will be warned for.
*/
blacklistedDomains: [],
/**
* @type {( string[] | false )}
* List of whitelisted links and usernames,
* For channels and groups to stop warning users for them.
* Pass false to whitelist all links and channels.
*/
excludeLinks: [],
/**
* @type {ms}
* Don't count warns older than this value towards automatic ban.
* [Look at typedef above for details.]
*/
expireWarnsAfter: Infinity,
/**
* @type {InlineKeyboard}
* Inline keyboard to be added to reply to /groups.
* We use it to display button opening our webpage.
*/
groupsInlineKeyboard: [],
numberOfWarnsToBan: 3,
/**
* @type {string[]}
* List of plugin names to be loaded.
* See Readme in plugins directory for more details.
*/
plugins: [],
/**
* @type {InlineKeyboard}
* Inline keyboard to be added to warn message.
* We use it to display button showing our rules.
*/
warnInlineKeyboard: [],
};
module.exports = Object.freeze(config);