-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathloader.js
More file actions
114 lines (113 loc) · 4.22 KB
/
Copy pathloader.js
File metadata and controls
114 lines (113 loc) · 4.22 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
const _load = match => {
s.get(msg.chat.id, 'services', (err, data) => {
if (data == 'true' || msg.text.match(/.*config.*/)) {
if (Array.isArray(match)) {
let recognized = false
_services.forEach((element, index) => {
if (_services[index].regex.test(msg.text)) {
recognized = true
var _match = msg.text.match(_services[index].regex)
const service = _services[index]
security.isSecure(msg, service.eval, secure => {
if (secure) {
service.fn(bot, msg, _match)
} else {
monitutils.notifyBlacklistedEval(msg, bot, service.member)
userutils.isUserBlacklisted(msg.from.id, (err, status) => {
if (!status) {
userutils.blacklistUser(
msg.from.id,
'Eval malicioso: `' + msg.text + '`',
err => {
if (!err) {
bot
.sendMessage(
msg.chat.id,
'Iiiiih, tá achando que sou troxa?! Não vou executar esse comando aí, não! Aliás, nenhum comando que venha de você será executado mais. Adeus.',
{
reply_to_message_id: msg.id
}
)
.catch(console.log)
} else {
bot
.sendMessage(
msg.chat.id,
'Iiiiih, tá achando que sou troxa?! Não vou executar esse comando aí, não!',
{
reply_to_message_id: msg.id
}
)
.catch(console.log)
monitutils.notifySharedAccount(
bot,
'Erro ao adicionar o user ' +
msg.from.id +
' à blacklist. err: `' +
JSON.stringify(err) +
'`'
)
}
}
)
} else {
bot
.sendMessage(
msg.chat.id,
'Não executo mais comandos vindos de você não, jovem',
{
reply_to_message_id: msg.id
}
)
.catch(console.log)
}
})
}
})
}
})
if (!recognized && msg.chat.type == 'private') {
services.masem.execute(bot, msg)
} else if (
!recognized &&
(msg.chat.type == 'group' || msg.chat.type == 'supergroup') &&
msg.text
) {
s.getGlobal('learn_global', (err, data) => {
if (data == 'true') {
s.get(msg.chat.id, 'learn_local', err => {
let hasLink = false
if (msg.entities) {
msg.entities.forEach(el => {
if (el.type == 'url' || el.type == 'text_link') {
hasLink = true
}
})
}
if (!hasLink) {
treta.insert(
{
message: msg.text,
group: msg.chat.id
},
err => {
if (err) {
monitutils.notifyAdmins(
bot,
`Erro ao salvar a mensagem no banco: ${JSON.stringify(
err
)}`
)
}
}
)
}
})
}
})
}
}
}
})
}
module.exports = _load