From c7bf0592207fb4139448874c4cc642f03852f5ad Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 16 Aug 2020 18:41:58 +0300 Subject: [PATCH] When creating a new thread from a mention, include a note and the initial message in the thread --- src/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 1928886..6e348c2 100644 --- a/src/main.js +++ b/src/main.js @@ -239,7 +239,9 @@ function initBaseMessageHandlers() { const existingThread = await threads.findOpenThreadByUserId(msg.author.id); if (! existingThread) { // Only open a thread if we don't already have one - await threads.createNewThreadForUser(msg.author, { quiet: true }); + const createdThread = await threads.createNewThreadForUser(msg.author, { quiet: true }); + await createdThread.postSystemMessage(`This thread was opened from a bot mention in <#${msg.channel.id}>`); + await createdThread.receiveUserReply(msg); } } });