From 454ab75fec7d36d09105c35ddabaf5f88f6e17ee Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Fri, 25 Sep 2020 01:42:37 +0300 Subject: [PATCH] Fix !newthread failing with uncached users --- src/modules/newthread.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/newthread.js b/src/modules/newthread.js index 79f5e97..3b094f1 100644 --- a/src/modules/newthread.js +++ b/src/modules/newthread.js @@ -3,7 +3,7 @@ const threads = require("../data/threads"); module.exports = ({ bot, knex, config, commands }) => { commands.addInboxServerCommand("newthread", "", async (msg, args, thread) => { - const user = bot.users.get(args.userId); + const user = bot.users.get(args.userId) || await bot.getRESTUser(args.userId).catch(() => null); if (! user) { utils.postSystemMessageWithFallback(msg.channel, thread, "User not found!"); return;