owobot/util/chatparse_1204.js
2024-07-28 16:30:19 -04:00

11 lines
300 B
JavaScript

const { processNbtMessage } = require('prismarine-chat')
const parse = function (data) {
if (typeof data.type === 'string') {
return JSON.parse(processNbtMessage(data))
} else if (typeof data === 'string') {
return JSON.parse(data)
} else {
return data
}
}
module.exports = parse