2020-12-18 13:37:56 +00:00
// SupportBot, Created by Emerald Services
2020-06-15 23:58:37 +01:00
// Links Command
2019-06-09 23:52:41 +01:00
2020-01-26 22:35:45 +00:00
const Discord = require ( "discord.js" );
const fs = require ( "fs" );
2020-06-15 23:58:37 +01:00
const yaml = require ( 'js-yaml' );
const { execute } = require ( "./help" );
2020-01-26 22:35:45 +00:00
const supportbot = yaml . load ( fs . readFileSync ( './supportbot-config.yml' , 'utf8' ));
2019-06-09 23:52:41 +01:00
2020-06-15 23:58:37 +01:00
module . exports = {
name : supportbot . LinksCommand ,
2020-07-14 19:42:46 +01:00
description : supportbot . LinksDesc ,
2019-06-09 23:52:41 +01:00
2020-06-15 23:58:37 +01:00
execute ( message , args ) {
2020-07-27 10:43:36 -04:00
if ( supportbot . DeleteMessages == "true" ) message . delete ();
2020-06-15 23:58:37 +01:00
2021-02-02 17:01:58 +00:00
console . log ( `\u001b[32m` , `[ ${ supportbot . Bot_Name } ]:` , `\u001b[32m` , ` ${ message . author . tag } has executed ${ supportbot . Prefix }${ supportbot . LinksCommand } !` );
2020-06-15 23:58:37 +01:00
const LinksEmbed = new Discord . MessageEmbed ()
. setColor ( supportbot . EmbedColour )
2019-06-09 23:52:41 +01:00
2020-06-15 23:58:37 +01:00
let botLinks = supportbot . LINKS ;
let links = '' ;
for ( let name in botLinks ) {
links += `[ ${ name } ]( ${ botLinks [ name ] } )\n` ;
};
2019-06-18 13:09:00 -03:00
2020-06-15 23:58:37 +01:00
LinksEmbed . addField ( supportbot . LinksTitle , links )
2019-07-24 16:52:30 -06:00
2020-06-15 23:58:37 +01:00
message . channel . send ({ embed : LinksEmbed });
2019-06-09 23:52:41 +01:00
2020-06-15 23:58:37 +01:00
}
2020-07-27 10:43:36 -04:00
};