Don't allow opening threads with bots with !newthread, fixes #452
parent
0c9302b41b
commit
9be6b2aa1f
|
@ -9,6 +9,11 @@ module.exports = ({ bot, knex, config, commands }) => {
|
||||||
return;
|
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);
|
const existingThread = await threads.findOpenThreadByUserId(user.id);
|
||||||
if (existingThread) {
|
if (existingThread) {
|
||||||
utils.postSystemMessageWithFallback(msg.channel, thread, `Cannot create a new thread; there is another open thread with this user: <#${existingThread.channel_id}>`);
|
utils.postSystemMessageWithFallback(msg.channel, thread, `Cannot create a new thread; there is another open thread with this user: <#${existingThread.channel_id}>`);
|
||||||
|
|
Loading…
Reference in New Issue