(message)
| 5 | const messageExpireTime = 420000 // 7 minutes (ms) |
| 6 | |
| 7 | function isFormatted (message) { |
| 8 | // This should match the ChatComponent.isDecorated function from Vanilla |
| 9 | try { |
| 10 | const comp = JSON.parse(message) |
| 11 | for (const key in comp) { |
| 12 | if (key !== 'text') return true |
| 13 | } |
| 14 | if (comp.text && comp.text !== message) return true |
| 15 | return false |
| 16 | } catch { |
| 17 | return false |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | module.exports = function (client, options) { |
| 22 | const mcData = require('minecraft-data')(client.version) |