2024-09-19 22:16:09 -04:00
|
|
|
const parsePlain = require('../../util/chatparse_plain.js')
|
2024-09-19 00:31:15 -04:00
|
|
|
module.exports = {
|
2024-09-19 22:21:01 -04:00
|
|
|
parse: (data, b) => {
|
|
|
|
if (data.type === 'profileless') {
|
|
|
|
if (data.playerChatType.translation_key === '%s') {
|
|
|
|
const parsed = parsePlain(data.json)
|
|
|
|
const split = parsed.split(': ')
|
|
|
|
const chatName = split.splice(0, 1)[0]
|
|
|
|
const chatNameSplit = chatName.split(' ')
|
|
|
|
const nickname = chatNameSplit[chatNameSplit.length - 1]
|
|
|
|
const username = b.findRealName(chatName)
|
|
|
|
const uuid = b.findUUID(username)
|
|
|
|
const message = split.join(': ')
|
2024-09-19 22:45:12 -04:00
|
|
|
return {
|
|
|
|
parsed: true,
|
2024-09-19 22:21:01 -04:00
|
|
|
json: data.json,
|
|
|
|
type: data.type,
|
|
|
|
subtype: 'extras_profileless',
|
|
|
|
uuid,
|
|
|
|
message,
|
|
|
|
nickname,
|
|
|
|
username
|
2024-09-19 22:45:12 -04:00
|
|
|
}
|
2024-09-19 00:31:15 -04:00
|
|
|
}
|
2024-09-19 22:21:01 -04:00
|
|
|
}
|
2024-09-19 22:45:12 -04:00
|
|
|
return {
|
|
|
|
parsed: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
priority: 1
|
2024-09-19 00:31:15 -04:00
|
|
|
}
|