From 6e8f729c4238e7dbcc0eb3dd8ae2969bb3387f2b Mon Sep 17 00:00:00 2001 From: Miikka Virtanen Date: Sat, 31 Dec 2016 01:33:00 +0200 Subject: [PATCH] More debug --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f9ccedd..c4f1602 100644 --- a/index.js +++ b/index.js @@ -216,13 +216,14 @@ function getModmailChannel(user, allowCreate = true) { } else { // If the cache value was invalid, remove it delete modMailChannels[user.id]; + console.log(`[NOTE] INVALID CACHE VALUE FOR ${user.id}`); } } // Try to find a matching channel let candidate = modMailGuild.channels.find(c => { const info = getModmailChannelInfo(c); - console.log(`testing ${info && info.userId} === ${user.id}`); + console.log(`[DEBUG] ${info && info.userId} === ${user.id} -> ${info && info.userId === user.id ? 'true' : 'false'}`); return info && info.userId === user.id; }); @@ -235,6 +236,7 @@ function getModmailChannel(user, allowCreate = true) { if (cleanName === '') cleanName = 'unknown'; // If one is not found, create and cache it + console.log(`[NOTE] Since no candidate was found, creating channel ${cleanName}-${user.discriminator}`); return modMailGuild.createChannel(`${cleanName}-${user.discriminator}`) .then(channel => { // This is behind a timeout because Discord was telling me the channel didn't exist after creation even though it clearly did