From 620ab79f71ea2525ab5fd86115af8451a742c3f8 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Thu, 22 Oct 2020 01:37:30 +0300 Subject: [PATCH] Add basic sticker receiving support No support for moderator replies with stickers. If a user sends the bot a sticker, the thread will show that sticker's name. Not all stickers can be linked to directly (as they're not all regular images), so this feels like the best compromise. --- src/data/Thread.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/data/Thread.js b/src/data/Thread.js index 09c75dc..4d60593 100644 --- a/src/data/Thread.js +++ b/src/data/Thread.js @@ -346,6 +346,16 @@ class Thread { messageContent = messageContent.trim(); } + if (msg.stickers && msg.stickers.length) { + const stickerLines = msg.stickers.map(sticker => { + return `**`; + }); + + messageContent += "\n\n" + stickerLines.join("\n"); + } + + messageContent = messageContent.trim(); + // Save DB entry let threadMessage = new ThreadMessage({ message_type: THREAD_MESSAGE_TYPE.FROM_USER,