owobot/util/chatparse_1204.js

12 lines
300 B
JavaScript
Raw Normal View History

2024-07-30 05:56:23 -04:00
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
}
}
2024-08-01 19:55:09 -04:00
module.exports = parse