From 4e667bc689ed757d8abae6acdc629f709a089a84 Mon Sep 17 00:00:00 2001 From: Miikka Virtanen Date: Sun, 1 Jan 2017 05:52:48 +0200 Subject: [PATCH] Temp solution for duplicate channels --- index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.js b/index.js index 907dddf..c5ae359 100644 --- a/index.js +++ b/index.js @@ -214,6 +214,17 @@ function getModmailChannel(user, allowCreate = true) { if (channel) { return Promise.resolve(channel); } else { + // FIXME: Temp fix, return mock channel and assume it exists.. maybe + const channelId = modMailChannels[user.id]; + return Promise.resolve({ + id: channelId, + name: 'temp-mock-channel', + createMessage: function() { + return modMailGuild.createMessage(channelId, ...arguments); + }, + mention: `<#${channelId}>`, + }); + // If the cache value was invalid, remove it delete modMailChannels[user.id]; console.log(`[NOTE] INVALID CACHE VALUE FOR ${user.id}`);