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 ;
2020-04-27 17:05:16 +02:00
const util = require ( 'util' ) ;
const exec = util . promisify ( require ( 'child_process' ) . exec ) ;
2019-03-25 00:51:33 +01:00
class aboutCommand extends Command {
constructor ( ) {
super ( 'about' , {
2019-04-21 12:06:38 +02:00
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 : [ '' ]
}
} ) ;
}
2020-08-03 11:26:20 +02:00
2019-03-25 00:51:33 +01:00
async exec ( message ) {
2019-10-27 00:55:13 +02:00
const Donator = await donator . findAll ( { order : [ 'id' ] } ) ;
2020-05-02 00:10:44 +02:00
let description = ` This bot is made using [discord.js](https://github.com/discordjs/discord.js) & [Discord-Akairo](https://github.com/discord-akairo/discord-akairo) \n Help command from [hoshi](https://github.com/1Computer1/hoshi) \n [Rantionary](https://github.com/RantLang/Rantionary) for their dictionnary. \n Thanks to ${ this . client . users . resolve ( '336492042299637771' ) . tag } (336492042299637771) for inspiring me for making this bot! \n \n The people who donated for the bot <3 \n ` ;
2019-10-27 00:55:13 +02:00
2019-10-27 13:15:25 +01:00
if ( Donator [ 0 ] ) {
for ( let i = 0 ; i < Donator . length ; i ++ ) {
2020-08-03 12:01:20 +02:00
if ( this . client . users . resolve ( Donator [ i ] . get ( 'userID' ) . toString ( ) ) !== null )
description += ` ** ${ this . client . users . resolve ( Donator [ i ] . get ( 'userID' ) . toString ( ) ) . tag } ( ${ Donator [ i ] . get ( 'userID' ) } ) | ${ Donator [ i ] . get ( 'comment' ) } ** \n ` ;
2020-08-03 11:26:20 +02:00
else
description += ` **A user of discord ( ${ Donator [ i ] . get ( 'userID' ) } ) | ${ Donator [ i ] . get ( 'comment' ) } (This user no longer share a server with the bot)** \n ` ;
2019-10-27 13:15:25 +01:00
}
} else {
2020-04-30 22:21:39 +02:00
description += 'No one :(\n' ;
2019-10-27 00:55:13 +02:00
}
2020-04-30 22:21:39 +02:00
description += '\nThanks to Jetbrains for providing their IDE!' ;
2020-04-27 17:05:16 +02:00
exec ( 'git rev-parse --short HEAD' )
. then ( out => {
const aboutEmbed = this . client . util . embed ( )
. setColor ( message . member ? message . member . displayHexColor : 'NAVY' )
. setAuthor ( this . client . user . username , this . client . user . avatarURL ( ) )
. setTitle ( 'About me' )
. setDescription ( description )
. addField ( 'Current commit' , out . stdout )
2020-05-02 00:10:44 +02:00
. addField ( 'Current owner: ' , ` ${ this . client . users . resolve ( this . client . ownerID ) . tag } ( ${ this . client . ownerID } ) ` )
2020-04-27 17:05:16 +02:00
. addField ( 'Gitlab' , 'https://gitlab.com/LoicBersier/DiscordBot' , true )
. addField ( 'Github' , 'https://github.com/loicbersier/Haha-yes' , true )
2020-04-30 22:21:39 +02:00
. setThumbnail ( 'https://its.gamingti.me/ZiRe.png' )
2020-08-03 11:26:20 +02:00
. setFooter ( ` Original bot made by ${ this . client . users . resolve ( '267065637183029248' ) . tag } (267065637183029248) ` ) ; // Please this line
2019-10-27 00:55:13 +02:00
2020-04-27 17:05:16 +02:00
message . channel . send ( aboutEmbed ) ;
} ) ;
2019-03-25 00:51:33 +01:00
}
}
module . exports = aboutCommand ;