Haha-Yes/commands/utility/about.js

46 lines
2.1 KiB
JavaScript
Raw Normal View History

2019-03-25 00:51:33 +01:00
const { Command } = require('discord-akairo');
2019-10-27 00:55:13 +02:00
const donator = require('../../models').donator;
2019-03-25 00:51:33 +01:00
class aboutCommand extends Command {
constructor() {
super('about', {
aliases: ['about', 'credit'],
2019-03-25 00:51:33 +01:00
category: 'utility',
2019-11-09 12:04:01 +01:00
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'],
2019-03-25 00:51:33 +01:00
description: {
content: 'About me ( the bot )',
usage: '',
examples: ['']
}
});
}
async exec(message) {
2019-10-27 00:55:13 +02:00
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 their dictionnary.\nThanks to ${this.client.users.get('336492042299637771').username}#${this.client.users.get('336492042299637771').discriminator} (336492042299637771) for inspiring me for making this bot!\n\nThe people who donated for the bot <3\n`;
2019-10-27 00:55:13 +02:00
if (Donator[0]) {
for (let i = 0; i < Donator.length; i++) {
2019-11-04 14:10:02 +01:00
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 :(';
2019-10-27 00:55:13 +02:00
}
2019-11-22 12:30:20 +01:00
const aboutEmbed = this.client.util.embed()
2019-11-02 00:54:40 +01:00
.setColor(message.member.displayHexColor)
.setAuthor(this.client.user.username, this.client.user.avatarURL())
2019-03-25 00:51:33 +01:00
.setTitle('About me')
2019-10-27 00:55:13 +02:00
.setDescription(description)
.addField('Current owner: ', `${this.client.users.get(this.client.ownerID).username}#${this.client.users.get(this.client.ownerID).discriminator} (${this.client.ownerID})`)
2019-11-21 15:08:58 +01:00
.addField('Gitlab', 'https://gitlab.com/LoicBersier/DiscordBot', true)
.addField('Github', 'https://github.com/loicbersier/Haha-yes', true)
.setFooter(`Original bot made by ${this.client.users.get('267065637183029248').username}#${this.client.users.get('267065637183029248').discriminator} (267065637183029248)`); // Please don't change the "original bot made by"
2019-03-25 00:51:33 +01:00
message.channel.send(aboutEmbed);
}
}
module.exports = aboutCommand;