aboutsummaryrefslogtreecommitdiff
path: root/webAO/viewport/utils
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2023-08-15 17:32:05 +0200
committerstonedDiscord <Tukz@gmx.de>2023-08-15 17:32:05 +0200
commitfc6b6ea1787e59b2974faab0f0ebbe62f876af15 (patch)
treef5f3afa83ec0c913af9a10525d877783118c2dc6 /webAO/viewport/utils
parent07d849f94f64fab7b68e47dfa7b5cce4e3c4a66a (diff)
spell out messages without markdown if it fails because the host is down
Diffstat (limited to 'webAO/viewport/utils')
-rw-r--r--webAO/viewport/utils/handleICSpeaking.ts17
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