minor edit

This commit is contained in:
Isaac (eartharoid) 2020-08-24 17:27:28 +01:00
parent a1ab50199f
commit 4009daffbb
3 changed files with 11 additions and 4 deletions

View File

@ -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 3. Commas should always have a space after them
4. Use tabs, not spaces, and always indent 4. Use tabs, not spaces, and always indent
5. Use arrow functions 5. Use arrow functions
**Note**: Create `user/dev.env` and `user/dev.config.js` for testing.

View File

@ -38,9 +38,14 @@ module.exports = {
value: '', value: '',
}); });
} else { } else {
panel = await client.channels.cache.get(chanID.get('value')).messages.fetch(msgID.get('value')); // get old panel message try {
if (panel) panel = await client.channels.cache.get(chanID.get('value')).messages.fetch(msgID.get('value')); // get old panel message
panel.delete({ reason: 'Creating new panel/widget' }).then(() => log.info('Deleted old panel')).catch(e => log.warn(e)); // delete old panel 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(); message.delete();

View File

@ -13,7 +13,7 @@
* > For detailed instructions, visit the GitHub repository and read the documentation: * > For detailed instructions, visit the GitHub repository and read the documentation:
* https://github.com/eartharoid/DiscordTickets/wiki * 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 * Support