forked from wrxck/mattata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.example.lua
363 lines (352 loc) · 15.4 KB
/
configuration.example.lua
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
--[[
_ _ _
_ __ ___ __ _| |_| |_ __ _| |_ __ _
| '_ ` _ \ / _` | __| __/ _` | __/ _` |
| | | | | | (_| | |_| || (_| | || (_| |
|_| |_| |_|\__,_|\__|\__\__,_|\__\__,_|
Configuration file for mattata v1.2
Copyright 2020 Matthew Hesketh <[email protected]>
This code is licensed under the MIT. See LICENSE for details.
Each value in an array should be comma separated, with the exception of the last value!
Make sure you always update your configuration file after pulling changes from GitHub!
]]
local configuration = { -- Rename this file to configuration.lua for the bot to work!
['bot_token'] = '', -- In order for the bot to actually work, you MUST insert the Telegram
-- bot API token you received from @BotFather.
['connected_message'] = 'Connected to the Telegram bot API!', -- The message to print when the bot is connected to the Telegram bot API.
['version'] = '1.2', -- the version of mattata, don't change this!
-- The following two tokens will require you to have setup payments with @BotFather, and
-- a Stripe account with @stripe!
['stripe_live_token'] = '', -- Payment token you receive from @BotFather.
['stripe_test_token'] = '', -- Test payment token you receive from @BotFather.
['admins'] = { -- Here you need to specify the numerical ID of the users who shall have
-- FULL control over the bot, this includes access to server files via the lua and shell plugins.
221714512
},
['blacklist_plugin_exceptions'] = { -- An array of plugins that will still be used for blacklisted users.
'antispam'
},
['beta_plugins'] = { -- An array of plugins that only the configured bot admins are able to use.
'array_of_beta_plugins_here'
},
['permanent_plugins'] = { -- An array of plugins that can't be disabled with /plugins.
'plugins',
'help',
'administration',
'about'
},
['updates'] = {
['timeout'] = 3, -- timeout in seconds for api.get_updates()
['limit'] = 100 -- message limit for api.get_updates() - must be between 1-100
},
['language'] = 'en', -- The two character locale to set your default language to.
['log_chat'] = nil, -- This needs to be the numerical identifier of the chat you wish to log
-- errors into. If it's not a private chat it should begin with a '-' symbol.
['log_admin_actions'] = true, -- Should administrative actions be logged? [true/false]
['log_channel'] = nil, -- This needs to be the numerical identifier of the channel you wish
-- to log administrative actions in by default. It should begin with a '-' symbol.
['bug_reports_chat'] = nil, -- This needs to be the numerical identifier of the chat you wish to send
-- bug reports into. If it's not a private chat it should begin with a '-' symbol.
['counter_channel'] = nil, -- This needs to be the numerical identifier of the channel you wish
-- to forward messages into, for use with the /counter command. It should begin with a '-' symbol.
['download_location'] = '/your/downloads/directory', -- The location to save all downloaded media to.
['fonts_directory'] = '/your/fonts/directory', -- The location where fonts are stored for CAPTCHAs
['respond_to_misc'] = true, -- Respond to shitpostings/memes in mattata.lua? [true/false]
['max_copypasta_length'] = 300, -- The maximum number of characters a message can have to be
-- able to have /copypasta used on it.
['debug'] = true, -- Turn this on to print EVEN MORE information to the terminal.
['redis'] = { -- Configurable options for connecting the bot to redis. Do NOT modify
-- these settings if you don't know what you're doing!
['host'] = '127.0.0.1',
['port'] = 6379,
['password'] = nil,
['db'] = 2
},
['keys'] = { -- API keys needed for the full functionality of several plugins.
['cats'] = '', -- http://thecatapi.com/api-key-registration.html
['translate'] = '', -- https://tech.yandex.com/keys/get/?service=trnsl
['lyrics'] = '', -- https://developer.musixmatch.com/admin/applications
['lastfm'] = '', -- http://www.last.fm/api/account/create
['weather'] = '', -- https://darksky.net/dev/register
['youtube'] = '', -- https://console.developers.google.com/apis
['maps'] = '', -- https://console.cloud.google.com/google/maps-apis
['location'] = '', -- https://opencagedata.com/api
['bing'] = '', -- https://datamarket.azure.com/account/keys
['flickr'] = '', -- https://www.flickr.com/services/apps/create/noncommercial/
['news'] = '', -- https://newsapi.org/
['twitch'] = '', -- https://twitchapps.com/tmi/
['pastebin'] = '', -- https://pastebin.com/api
['dictionary'] = { -- https://developer.oxforddictionaries.com/
['id'] = '',
['key'] = ''
},
['adfly'] = { -- https://ay.gy/publisher/tools#tools-api
['api_key'] = '',
['user_id'] = '',
['secret_key'] = ''
},
['pasteee'] = '', -- https://paste.ee/
['google'] = { -- https://console.developers.google.com/apis
['api_key'] = '',
['cse_key'] = ''
},
['steam'] = '', -- https://steamcommunity.com/dev/apikey
['spotify'] = { -- https://developer.spotify.com/my-applications/#!/applications/create
['client_id'] = '',
['client_secret'] = '',
['redirect_uri'] = ''
},
['twitter'] = { -- https://apps.twitter.com/app/new
['consumer_key'] = '',
['consumer_secret'] = ''
},
['imgur'] = { -- https://api.imgur.com/oauth2/addclient
['client_id'] = '',
['client_secret'] = ''
},
['spamwatch'] = '' -- https://t.me/SpamWatchSupport
},
['errors'] = { -- Messages to provide a more user-friendly approach to errors.
['connection'] = 'Connection error.',
['results'] = 'I couldn\'t find any results for that.',
['supergroup'] = 'This command can only be used in supergroups.',
['admin'] = 'You need to be a moderator or an administrator in this chat in order to use this command.',
['unknown'] = 'I don\'t recognise that user. If you would like to teach me who they are, forward a message from them to any chat that I\'m in.',
['generic'] = 'An unexpected error occured. Please report this error using /bugreport.'
},
['limits'] = {
['bing'] = {
['private'] = 15,
['public'] = 7
},
['stackoverflow'] = {
['private'] = 12,
['public'] = 8
},
['reddit'] = {
['private'] = 8,
['public'] = 4
},
['chatroulette'] = 512,
['copypasta'] = 300,
['drawtext'] = 1000,
['help'] = {
['per_page'] = 4
}
},
['administration'] = { -- Values used in administrative plugins
['warnings'] = {
['maximum'] = 10,
['minimum'] = 2,
['default'] = 3
},
['allowed_links'] = {
'username',
'telegram',
'mattata',
'admin',
'admins'
},
['store_chat_members'] = true,
['global_antispam'] = { -- normal antispam is processed in plugins/antispam.mattata
['ttl'] = 5, -- amount of seconds to process the messages in
['message_warning_amount'] = 10, -- amount of messages a user can send in the TTL until they're warned
['message_blacklist_amount'] = 25, -- amount of messages a user can send in the TTL until they're blacklisted
['blacklist_length'] = 86400, -- amount (in seconds) to blacklist the user for (set it to -1 if you want it forever)
['max_code_length'] = 64 -- maximum length of code or pre entities that are allowed with "remove pasted code" setting on
},
['default'] = {
['antispam'] = {
['text'] = 8,
['forwarded'] = 16,
['sticker'] = 4,
['photo'] = 4,
['video'] = 4,
['location'] = 4,
['voice'] = 4,
['game'] = 2,
['venue'] = 4,
['video_note'] = 4,
['invoice'] = 2,
['contact'] = 2,
['dice'] = 1,
['poll'] = 1
}
},
['feds'] = {
['group_limit'] = 3,
['shortened_feds'] = {
['name'] = 'uuid'
}
},
['voteban'] = {
['upvotes'] = {
['maximum'] = 50,
['minimum'] = 2,
['default'] = 5
},
['downvotes'] = {
['maximum'] = 50,
['minimum'] = 2,
['default'] = 5
}
}
},
['join_messages'] = { -- Values used in plugins/administration.lua.
'Welcome, NAME!',
'Hello, NAME!',
'Enjoy your stay, NAME!',
'I\'m glad you joined, NAME!',
'Howdy, NAME!',
'Hi, NAME!'
},
['groups'] = {
['name'] = 'https://t.me/link'
},
['sort_groups'] = true, -- Decides whether groups will be sorted by name in /groups.
['stickers'] = { -- Values used in mattata.lua, for administrative plugin functionality.
-- These are the file_id values for stickers which are binded to the relevant command.
['ban'] = {
'AgAD0AIAAlAYNw0',
'AgADzwIAAlAYNw0'
},
['warn'] = {
'AgAD0QIAAlAYNw0',
'AgAD0gIAAlAYNw0'
},
['kick'] = {
'AgAD0wIAAlAYNw0'
}
},
['slaps'] = {
'{THEM} was shot by {ME}.',
'{THEM} was pricked to death.',
'{THEM} walked into a cactus while trying to escape {ME}.',
'{THEM} drowned.',
'{THEM} drowned whilst trying to escape {ME}.',
'{THEM} blew up.',
'{THEM} was blown up by {ME}.',
'{THEM} hit the ground too hard.',
'{THEM} fell from a high place.',
'{THEM} fell off a ladder.',
'{THEM} fell into a patch of cacti.',
'{THEM} was doomed to fall by {ME}.',
'{THEM} was blown from a high place by {ME}.',
'{THEM} was squashed by a falling anvil.',
'{THEM} went up in flames.',
'{THEM} burned to death.',
'{THEM} was burnt to a crisp whilst fighting {ME}.',
'{THEM} walked into a fire whilst fighting {ME}.',
'{THEM} tried to swim in lava.',
'{THEM} tried to swim in lava whilst trying to escape {ME}.',
'{THEM} was struck by lightning.',
'{THEM} was slain by {ME}.',
'{THEM} got finished off by {ME}.',
'{THEM} was killed by magic.',
'{THEM} was killed by {ME} using magic.',
'{THEM} starved to death.',
'{THEM} suffocated in a wall.',
'{THEM} fell out of the world.',
'{THEM} was knocked into the void by {ME}.',
'{THEM} withered away.',
'{THEM} was pummeled by {ME}.',
'{THEM} was fragged by {ME}.',
'{THEM} was desynchronized.',
'{THEM} was wasted.',
'{THEM} was busted.',
'{THEM}\'s bones are scraped clean by the desolate wind.',
'{THEM} has died of dysentery.',
'{THEM} fainted.',
'{THEM} is out of usable Pokemon! {THEM} whited out!',
'{THEM} is out of usable Pokemon! {THEM} blacked out!',
'{THEM} whited out!',
'{THEM} blacked out!',
'{THEM} says goodbye to this cruel world.',
'{THEM} got rekt.',
'{THEM} was sawn in half by {ME}.',
'{THEM} died. I blame {ME}.',
'{THEM} was axe-murdered by {ME}.',
'{THEM}\'s melon was split by {ME}.',
'{THEM} was sliced and diced by {ME}.',
'{THEM} was split from crotch to sternum by {ME}.',
'{THEM}\'s death put another notch in {ME}\'s axe.',
'{THEM} died impossibly!',
'{THEM} died from {ME}\'s mysterious tropical disease.',
'{THEM} escaped infection by dying.',
'{THEM} played hot-potato with a grenade.',
'{THEM} was knifed by {ME}.',
'{THEM} fell on his sword.',
'{THEM} ate a grenade.',
'{THEM}\'s parents got shot by {ME}.',
'{THEM} practiced being {ME}\'s clay pigeon.',
'{THEM} is what\'s for dinner!',
'{THEM} was terminated by {ME}.',
'{THEM} was shot before being thrown out of a plane.',
'{THEM} was not invincible.',
'{THEM} has encountered an error.',
'{THEM} died and reincarnated as a goat.',
'{ME} threw {THEM} off a building.',
'{THEM} is sleeping with the fishes.',
'{THEM} got a premature burial.',
'{ME} replaced all of {THEM}\'s music with Nickelback.',
'{ME} spammed {THEM}\'s email.',
'{ME} cut {THEM}\'s genitals off with a rusty pair of scissors!',
'{ME} made {THEM} a knuckle sandwich.',
'{ME} slapped {THEM} with pure nothing.',
'{ME} hit {THEM} with a small, interstellar spaceship.',
'{THEM} was quickscoped by {ME}.',
'{ME} put {THEM} in check-mate.',
'{ME} RSA-encrypted {THEM} and deleted the private key.',
'{ME} put {THEM} in the friendzone.',
'{ME} molested {THEM} in a shed.',
'{ME} slaps {THEM} with a DMCA takedown request!',
'{THEM} became a corpse blanket for {ME}.',
'Death is when the monsters get you. Death comes for {THEM}.',
'Cowards die many times before their death. {THEM} never tasted death but once.',
'{THEM} died of hospital gangrene.',
'{THEM} got a house call from Doctor {ME}.',
'{ME} beheaded {THEM}.',
'{THEM} got stoned...by an angry mob.',
'{ME} sued the pants off {THEM}.',
'{THEM} was impeached.',
'{THEM} was beaten to a pulp by {ME}.',
'{THEM} was forced to have cheeky bum sex with {ME}!',
'{THEM} was one-hit KO\'d by {ME}.',
'{ME} sent {THEM} to /dev/null.',
'{ME} sent {THEM} down the memory hole.',
'{THEM} was a mistake.',
'{THEM} is a failed abortion.',
'{THEM}\'s birth certificate is just an apology letter from their local condom dispensary.',
'\'{THEM} was a mistake.\' - {ME}',
'{ME} checkmated {THEM} in two moves.',
'{THEM} was brutally raped by {ME}.'
}
}
local get_plugins = function(extension, directory)
extension = extension and tostring(extension) or 'mattata'
if extension:match('^%.') then
extension = extension:match('^%.(.-)$')
end
directory = directory and tostring(directory) or 'plugins'
if directory:match('/$') then
directory = directory:match('^(.-)/$')
end
local plugins = {}
local all = io.popen('ls ' .. directory .. '/'):read('*all')
for plugin in all:gmatch('[%w_-]+%.' .. extension .. ' ?') do
plugin = plugin:match('^([%w_-]+)%.' .. extension .. ' ?$')
table.insert(plugins, plugin)
end
return plugins
end
configuration.plugins = get_plugins()
configuration.administrative_plugins = get_plugins(nil, 'plugins/administration')
for _, v in pairs(configuration.administrative_plugins) do
table.insert(configuration.plugins, v)
end
return configuration
--[[
End of configuration, you're good to go.
Use `./launch.sh` to start the bot.
If you can't execute the script, try running `chmod +x launch.sh`
]]