From 9be6b2aa1f2571fdbfd5c738811179b7108d1987 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Wed, 23 Sep 2020 01:04:40 +0300 Subject: [PATCH] Don't allow opening threads with bots with !newthread, fixes #452 --- src/modules/newthread.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/newthread.js b/src/modules/newthread.js index 22bae22..79f5e97 100644 --- a/src/modules/newthread.js +++ b/src/modules/newthread.js @@ -9,6 +9,11 @@ module.exports = ({ bot, knex, config, commands }) => { return; } + if (user.bot) { + utils.postSystemMessageWithFallback(msg.channel, thread, "Can't create a thread for a bot"); + return; + } + const existingThread = await threads.findOpenThreadByUserId(user.id); if (existingThread) { utils.postSystemMessageWithFallback(msg.channel, thread, `Cannot create a new thread; there is another open thread with this user: <#${existingThread.channel_id}>`);