diff options
| author | stonedDiscord <Tukz@gmx.de> | 2023-08-15 17:32:05 +0200 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2023-08-15 17:32:05 +0200 |
| commit | fc6b6ea1787e59b2974faab0f0ebbe62f876af15 (patch) | |
| tree | f5f3afa83ec0c913af9a10525d877783118c2dc6 /webAO | |
| parent | 07d849f94f64fab7b68e47dfa7b5cce4e3c4a66a (diff) | |
spell out messages without markdown if it fails because the host is down
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/viewport/utils/handleICSpeaking.ts | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/webAO/viewport/utils/handleICSpeaking.ts b/webAO/viewport/utils/handleICSpeaking.ts index b1aa02d..e8fd251 100644 --- a/webAO/viewport/utils/handleICSpeaking.ts +++ b/webAO/viewport/utils/handleICSpeaking.ts @@ -301,11 +301,16 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { client.viewport.getChatmsg().sound = client.viewport.getChatmsg().effects[2]; } - client.viewport.getChatmsg().parsed = await attorneyMarkdown.applyMarkdown( - client.viewport.getChatmsg().content, - - COLORS[client.viewport.getChatmsg().color] - - ); + try { + client.viewport.getChatmsg().parsed = await attorneyMarkdown.applyMarkdown( + client.viewport.getChatmsg().content, + + COLORS[client.viewport.getChatmsg().color] + + ); + } catch (error) { + console.warn("markdown failed"); + } + client.viewport.chat_tick(); };
\ No newline at end of file |
