Fix !newthread failing with uncached users

cshd
Dragory 2020-09-25 01:42:37 +03:00
parent 4bdcf1e427
commit 454ab75fec
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
1 changed files with 1 additions and 1 deletions

View File

@ -3,7 +3,7 @@ const threads = require("../data/threads");
module.exports = ({ bot, knex, config, commands }) => {
commands.addInboxServerCommand("newthread", "<userId:userId>", 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;