From f6833865838ceb94de7be07bc5578e0da11bbf52 Mon Sep 17 00:00:00 2001 From: Josh Creek Date: Mon, 26 Oct 2020 22:42:11 +0000 Subject: [PATCH] fix(*): Fix broken adventure channel deletion --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 92f962b..80c6abf 100644 --- a/index.js +++ b/index.js @@ -155,6 +155,8 @@ function makeTempChannel(message, adventureMessage) { } function deleteChannel(message, channelId) { + // For some reason this errors without the console.log loading the cache first - not sure why + console.log(message.guild.channels.cache); const fetchedChannel = message.guild.channels.cache.get(channelId); fetchedChannel.delete(); } @@ -284,7 +286,7 @@ client.on('message', function (message) { if (command === 'dc') { // todo - add logic here to determine if they can delete the channel (i.e. it's their temporary one) - compare the name if (message.channel.name === getChannelName(message.author.username)) { - deleteChannel(message.channel.id) + deleteChannel(message, message.channel.id) logger.log('info', `${message.author.username} deleted their adventure channel.`); } else {