better way to show people who donated

This commit is contained in:
loicbersier 2019-10-27 00:55:13 +02:00
parent 2b5f189204
commit adc33d66ad
2 changed files with 22 additions and 2 deletions

View file

@ -1,6 +1,7 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const { MessageEmbed } = require('discord.js'); const { MessageEmbed } = require('discord.js');
const { ownerID } = require('../../config.json'); const { ownerID } = require('../../config.json');
const donator = require('../../models').donator;
class aboutCommand extends Command { class aboutCommand extends Command {
constructor() { constructor() {
@ -16,12 +17,22 @@ class aboutCommand extends Command {
} }
async exec(message) { 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';
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`;
}
const aboutEmbed = new MessageEmbed() const aboutEmbed = new MessageEmbed()
.setColor('#ff9900') .setColor('#ff9900')
.setAuthor(`${this.client.users.get(ownerID).username}#${this.client.users.get(ownerID).discriminator} (${ownerID})`, this.client.user.avatarURL) .setAuthor(`${this.client.users.get(ownerID).username}#${this.client.users.get(ownerID).discriminator} (${ownerID})`, this.client.user.avatarURL)
.setTitle('About me') .setTitle('About me')
.setURL('https://gitlab.com/LoicBersier/DiscordBot') .setURL('https://gitlab.com/LoicBersier/DiscordBot')
.setDescription(`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${this.client.users.get('294160866268413952').username}#${this.client.users.get('294160866268413952').discriminator} (294160866268413952)\n${this.client.users.get('428387534842626048').username}#${this.client.users.get('428387534842626048').discriminator} (428387534842626048)`) .setDescription(description)
.setFooter(`Gitlab link in the title | Original bot made by ${this.client.users.get('267065637183029248').username}#${this.client.users.get('267065637183029248').discriminator} (267065637183029248)`); .setFooter(`Gitlab link in the title | Original bot made by ${this.client.users.get('267065637183029248').username}#${this.client.users.get('267065637183029248').discriminator} (267065637183029248)`);
message.channel.send(aboutEmbed); message.channel.send(aboutEmbed);

View file

@ -1,4 +1,5 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const donator = require('../../models').donator;
class donatorCommand extends Command { class donatorCommand extends Command {
constructor() { constructor() {
@ -14,7 +15,15 @@ class donatorCommand extends Command {
} }
async exec(message) { async exec(message) {
return message.channel.send(`Thanks to:\n${this.client.users.get('294160866268413952').username}#${this.client.users.get('294160866268413952').discriminator} (294160866268413952)\n${this.client.users.get('428387534842626048').username}#${this.client.users.get('428387534842626048').discriminator} (428387534842626048)`); const Donator = await donator.findAll({order: ['id']});
let donatorMessage = 'Thanks to:\n';
for (let i = 0; i < Donator.length; i++) {
donatorMessage += `${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`;
}
return message.channel.send(donatorMessage);
} }
} }