43e5731f515cbd4fef49397bc1a1903ed16a5eb603ab725546063cc6cb19fd36
This commit is contained in:
parent
fffbb1938e
commit
d4a94c03bc
1 changed files with 6 additions and 6 deletions
|
@ -189,18 +189,18 @@ export default function load (b) {
|
|||
})
|
||||
|
||||
b.on('chat', (data) => {
|
||||
b.messageCount++
|
||||
if (Date.now() < b.chatDisabledUntil) return
|
||||
if (b.messageCount >= 100) {
|
||||
b.info(getMessage(settings.defaultLang, 'chat.antiSpamTriggered'))
|
||||
b.chatDisabledUntil = Date.now() + 30000
|
||||
return
|
||||
}
|
||||
const msgConsole = parseConsole(data.json)
|
||||
const msgPlain = parsePlain(data.json)
|
||||
if (settings.logJSONmessages) console.log(data.json)
|
||||
if (msgPlain.endsWith('\n\n\n\n\nThe chat has been cleared')) return
|
||||
if (msgPlain.startsWith('Command set: ')) return
|
||||
b.messageCount++
|
||||
if (b.messageCount >= 100) {
|
||||
b.info(getMessage(settings.defaultLang, 'chat.antiSpamTriggered'))
|
||||
b.chatDisabledUntil = Date.now() + 20000
|
||||
return
|
||||
}
|
||||
b.emit('plainchat', msgPlain, data.type, data.subtype)
|
||||
b.displayChat(data.type, data.subtype, `${msgConsole}\x1b[0m`)
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue