From 4009daffbb1afe906b1e683a94f9b0cdc5d700c5 Mon Sep 17 00:00:00 2001 From: "Isaac (eartharoid)" Date: Mon, 24 Aug 2020 17:27:28 +0100 Subject: [PATCH] minor edit --- .github/CONTRIBUTING.md | 2 ++ src/commands/panel.js | 11 ++++++++--- user/config.js | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index fc5d6d6..e39c070 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -25,3 +25,5 @@ When contributing, you should follow the same code style already used throughout 3. Commas should always have a space after them 4. Use tabs, not spaces, and always indent 5. Use arrow functions + +**Note**: Create `user/dev.env` and `user/dev.config.js` for testing. diff --git a/src/commands/panel.js b/src/commands/panel.js index 12be5fe..7709a45 100644 --- a/src/commands/panel.js +++ b/src/commands/panel.js @@ -38,9 +38,14 @@ module.exports = { value: '', }); } else { - panel = await client.channels.cache.get(chanID.get('value')).messages.fetch(msgID.get('value')); // get old panel message - if (panel) - panel.delete({ reason: 'Creating new panel/widget' }).then(() => log.info('Deleted old panel')).catch(e => log.warn(e)); // delete old panel + try { + panel = await client.channels.cache.get(chanID.get('value')).messages.fetch(msgID.get('value')); // get old panel message + if (panel) + panel.delete({ reason: 'Creating new panel/widget' }).then(() => log.info('Deleted old panel')).catch(e => log.warn(e)); // delete old panel + } catch (e) { + log.warn('Couldn\'t delete old panel'); + } + } message.delete(); diff --git a/user/config.js b/user/config.js index 9967cfc..7568008 100644 --- a/user/config.js +++ b/user/config.js @@ -13,7 +13,7 @@ * > For detailed instructions, visit the GitHub repository and read the documentation: * https://github.com/eartharoid/DiscordTickets/wiki * - * > IMPORTANT: Also rename 'user/example.env' to 'user/.env' and edit the TOKEN + * > IMPORTANT: Also edit the TOKEN in 'user/.env' * * --------------------- * Support