Change chat length based on version
This commit is contained in:
parent
e609a1b716
commit
54fd31f890
1 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
const protover = require("../util/getProtocolVersion.js")
|
||||
module.exports = {
|
||||
load: (b) => {
|
||||
b._client.on('login', () => {
|
||||
|
@ -8,10 +9,14 @@ module.exports = {
|
|||
}
|
||||
}, 100)
|
||||
})
|
||||
b.matcherRegex = /.{1,99}/g;
|
||||
if(protover(b._client.version) >= 306){ // 16w38a
|
||||
b.matcherRegex = /.{1,255}/g
|
||||
}
|
||||
b.chatqueue = []
|
||||
b.chat = function chat (msg) {
|
||||
if (msg.length === 0) return
|
||||
msg.match(/.{1,255}/g).forEach(element => {
|
||||
msg.match(b.matcherRegex).forEach(element => {
|
||||
b.chatqueue.push(element)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue