From fc6b6ea1787e59b2974faab0f0ebbe62f876af15 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 15 Aug 2023 17:32:05 +0200 Subject: spell out messages without markdown if it fails because the host is down --- webAO/viewport/utils/handleICSpeaking.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'webAO/viewport/utils/handleICSpeaking.ts') 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 -- cgit