Skip to content

Commit d35bf41

Browse files
committed
fix: fix displaying of unsigned messages (still need to simplify weird mineflayer parsing)
1 parent e7b012c commit d35bf41

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/chatUtils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const formatMessage = (message: MessageInput, mcData: IndexedData = globa
4444
obfuscated: !!msg.obfuscated
4545
}
4646

47+
if (!msg.text && typeof msg.json?.[''] === 'string') msg.text = msg.json['']
4748
if (msg.text) {
4849
msglist.push({
4950
...msg,

src/react/ChatProvider.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export default () => {
2525
useEffect(() => {
2626
bot.addListener('message', (jsonMsg, position) => {
2727
if (position === 'game_info') return // ignore action bar messages, they are handled by the TitleProvider
28+
if (jsonMsg['unsigned']) {
29+
jsonMsg = jsonMsg['unsigned']
30+
}
2831
const parts = formatMessage(jsonMsg)
2932

3033
setMessages(m => {

0 commit comments

Comments
 (0)