2019-06-09 23:52:41 +01:00
// SupportBot
// Command: Help
2019-06-18 13:09:00 -03:00
const Discord = require ( "discord.js" );
2019-06-09 23:52:41 +01:00
const bot = new Discord . Client ()
2019-06-18 13:09:00 -03:00
bot . settings = require ( "../settings.json" );
2019-06-09 23:52:41 +01:00
2019-06-18 13:09:00 -03:00
exports . run = ( bot , message , args ) => {
2019-06-09 23:52:41 +01:00
message . delete ();
2019-06-18 13:09:00 -03:00
let botLinks = bot . settings . LINKS ;
2019-06-09 23:52:41 +01:00
2019-06-18 13:09:00 -03:00
let links = '' ;
2019-06-09 23:52:41 +01:00
2019-06-18 13:09:00 -03:00
for ( let name in botLinks ) {
links += `[ ${ name } ]( ${ botLinks [ name ] } )\n` ;
}
let embed = new Discord . RichEmbed ()
. setTitle ( bot . settings . LINKS_TITLE )
. setDescription ( links )
. setColor ( bot . settings . colour )
. setFooter ( bot . settings . footer )
message . channel . send ( embed );
console . log ( `\x1b[36m` , ` ${ message . author } has executed ${ bot . settings . prefix }${ bot . settings . Link_Command } ` )
2019-06-09 23:52:41 +01:00
2019-07-24 16:52:30 -06:00
const CMDLog = new Discord . RichEmbed ()
. setTitle ( bot . settings . Commands_Log_Title )
. addField ( `User` , `<@ ${ message . author . id } >` )
. addField ( `Command` , bot . settings . Link_Command , true )
. addField ( `Channel` , message . channel , true )
. addField ( `Executed At` , message . createdAt , true )
. setColor ( bot . settings . colour )
. setFooter ( bot . settings . footer )
let CommandLog = message . guild . channels . find ( LogsChannel => LogsChannel . name === ` ${ bot . settings . Command_Log_Channel } ` );
if ( ! CommandLog ) return message . channel . send ( `:x: Error! Could not find the logs channel. ** ${ bot . settings . Command_Log_Channel } **\nThis can be changed via ``settings.json``` );
CommandLog . send ( CMDLog );
2019-06-09 23:52:41 +01:00
}
exports . help = {
name : bot . settings . Link_Command ,
}