From 8c585951aa21b60d916e5bfc8870eb4bacdc1fcc Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sun, 27 Oct 2019 13:15:25 +0100 Subject: [PATCH] fixed typo and made it show "no one :(" when there is no entry in the donator table --- commands/utility/about.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/commands/utility/about.js b/commands/utility/about.js index 824e51df..5099eb2c 100644 --- a/commands/utility/about.js +++ b/commands/utility/about.js @@ -19,14 +19,20 @@ class aboutCommand extends Command { async exec(message) { const Donator = await donator.findAll({order: ['id']}); - let description = 'This bot is made using [discord.js](https://github.com/discordjs/discord.js) & [Discord-Akairo](https://github.com/discord-akairo/discord-akairo)\nHelp command from [hoshi](https://github.com/1Computer1/hoshi)\n* [Rantionary](https://github.com/RantLang/Rantionary) for there dictionnary.\nThanks to Tina the Cyclops girl#5759 for inspiring me for making this bot!\n\nThe people who donated for the bot <3\n'; + let description = 'This bot is made using [discord.js](https://github.com/discordjs/discord.js) & [Discord-Akairo](https://github.com/discord-akairo/discord-akairo)\nHelp command from [hoshi](https://github.com/1Computer1/hoshi)\n[Rantionary](https://github.com/RantLang/Rantionary) for their dictionnary.\nThanks to Tina the Cyclops girl#5759 for inspiring me for making this bot!\n\nThe people who donated for the bot <3\n'; - for (let i = 0; i < Donator.length; i++) { - description += `${this.client.users.get(Donator[i].get('userID')).username}#${this.client.users.get(Donator[i].get('userID')).discriminator} (${Donator[i].get('userID')}) ${Donator[i].get('comment')}\n`; + if (Donator[0]) { + for (let i = 0; i < Donator.length; i++) { + description += `**${this.client.users.get(Donator[i].get('userID')).username}#${this.client.users.get(Donator[i].get('userID')).discriminator} (${Donator[i].get('userID')}) ${Donator[i].get('comment')}**\n`; + } + } else { + description += 'No one :('; } + + const aboutEmbed = new MessageEmbed() .setColor('#ff9900') .setAuthor(`${this.client.users.get(ownerID).username}#${this.client.users.get(ownerID).discriminator} (${ownerID})`, this.client.user.avatarURL)