2020-06-15 23:58:37 +01:00
// SupportBot 6.0, Created by Emerald Services
// Links Command
2019-11-15 20:27:10 +00: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 : "bob" ,
2020-01-26 22:35:45 +00:00
2020-06-15 23:58:37 +01:00
execute ( message , args ) {
2020-06-21 15:56:16 +01:00
console . log ( `\u001b[32m` , `[ ${ supportbot . Bot_Name } ]:` , `\u001b[32m` , ` ${ message . author . tag } has executed ${ supportbot . Prefix }${ supportbot . CloseTicket } !` );
2020-06-24 09:50:14 +01:00
if ( ! message . channel . name . startsWith ( ` ${ TicketChannel } -` )) {
const Exists = new Discord . MessageEmbed ()
. setTitle ( "Incorrect Channel" )
. setDescription ( `:warning: You cannot execute this command here. This command is used when closing a ticket.` )
. setColor ( supportbot . WarningColour );
message . channel . send ({ embed : Exists });
return ;
2020-06-21 15:56:16 +01:00
}
2020-06-24 09:50:14 +01:00
if ( supportbot . CloseConfirmation === "true" ) {
const CloseTicketRequest = new Discord . MessageEmbed ()
. setDescription ( `** ${ supportbot . ClosingTicket } **` )
. addField ( "Please confirm by repeating the following word.." , `** ${ supportbot . ClosingConfirmation_Word } **` )
2020-06-21 15:56:16 +01:00
}
2020-06-24 09:50:14 +01:00
2019-11-17 21:27:13 +00:00
}
2020-06-15 23:58:37 +01:00
};