owobot/plugins/cq.js

20 lines
462 B
JavaScript
Raw Normal View History

2024-07-28 16:30:19 -04:00
module.exports = {
2024-07-29 01:35:26 -04:00
load: (b) => {
2024-07-28 16:30:19 -04:00
b._client.on('login', () => {
b.interval.chatQueue = setInterval(() => {
if (b.chatqueue.length !== 0) {
b._client.chat(b.chatqueue[0])
b.chatqueue.splice(0, 1)
}
}, 150)
})
b.chatqueue = []
b.chat = function chat (msg) {
if (msg.length === 0) return
msg.match(/.{1,250}/g).forEach(element => {
b.chatqueue.push(element)
})
}
}
}