diff --git a/src/modules/block.js b/src/modules/block.js index 0f6e21983..278f6fce3 100644 --- a/src/modules/block.js +++ b/src/modules/block.js @@ -48,7 +48,19 @@ module.exports = ({ bot, knex, config, commands }) => { ? moment.utc().add(args.blockTime, "ms").format("YYYY-MM-DD HH:mm:ss") : null; - const user = bot.users.get(userIdToBlock); + let user = bot.users.get(userIdToBlock); + + if (! user) { + try { + console.log(`Getting data for user ${userIdToBlock} from the REST API...`); + user = await bot.getRESTUser(userIdToBlock); + } catch (e) { + console.log(e); + channel.createMessage(`Unable to block user due to an internal error.`); + return; + } + } + await blocked.block(userIdToBlock, (user ? user.username : ""), msg.author.id, expiresAt); if (expiresAt) { diff --git a/src/modules/logs.js b/src/modules/logs.js index 4f27ecbc2..9c80bb067 100644 --- a/src/modules/logs.js +++ b/src/modules/logs.js @@ -50,7 +50,7 @@ module.exports = ({ bot, knex, config, commands, hooks }) => { const formattedLogUrl = logUrl ? `<${addOptQueryStringToUrl(logUrl, args)}>` : `View log with \`${config.prefix}log ${userThread.thread_number}\`` - const formattedDate = moment.utc(userThread.created_at).format("MMM Do [at] HH:mm [UTC]"); + const formattedDate = moment.utc(userThread.created_at).format("MMM Do YYYY [at] HH:mm [UTC]"); return `\`#${userThread.thread_number}\` \`${formattedDate}\`: ${formattedLogUrl}`; })); diff --git a/src/modules/typingProxy.js b/src/modules/typingProxy.js index e84d085ed..03945c807 100644 --- a/src/modules/typingProxy.js +++ b/src/modules/typingProxy.js @@ -12,7 +12,7 @@ module.exports = ({ bot }) => { } // config.typingProxy: forward user typing in a DM to the modmail thread - if (config.typingProxy && (channel instanceof Eris.PrivateChannel)) { + if (config.typingProxy && !channel.guild) { const thread = await threads.findOpenThreadByUserId(user.id); if (! thread) return;