2021-01-23 18:08:47 -06:00
module . exports = {
2022-04-18 11:25:40 -05:00
name : require ( 'path' ) . parse ( _ _filename ) . name ,
2022-03-28 12:42:09 -05:00
description : "IT'S TIME TO STOP!... the bot" ,
2022-04-21 20:53:03 -05:00
options : [ ] ,
2022-04-21 18:09:21 -05:00
2022-04-21 23:44:02 -05:00
async parseInteraction ( client , config , interaction ) {
2022-11-10 14:52:49 -06:00
await this . handle ( client , config , interaction ) ;
2022-04-21 23:44:02 -05:00
} ,
2022-11-10 14:52:49 -06:00
async handle ( client , config , interaction ) {
if ( interaction . user . id === process . env . OWNERID ) {
console . log ( '[SYSTEM] [INFO] ' + ` The bot is going down for shut down. Shutdown requested by ${ interaction . user . username } ` ) ;
await interaction . reply ( {
2022-04-21 18:09:21 -05:00
embeds : [ {
2022-11-10 14:52:49 -06:00
title : 'Shutdown bot' ,
description : '<a:AnitroxWorking:997565411212144730> Shutting Down...' ,
2022-04-21 18:09:21 -05:00
color : 9442302 ,
footer : {
2022-11-10 14:52:49 -06:00
icon _url : interaction . user . displayAvatarURL ( ) ,
2022-04-21 18:09:21 -05:00
text : config . footerTxt
}
} ]
2022-07-03 18:12:53 -05:00
} ) ;
process . exit ( ) ;
2022-03-26 03:33:18 -05:00
} else {
2022-11-10 14:52:49 -06:00
console . error ( '[SYSTEM] [ERR] User ' + interaction . user . username + " tried to shut down the bot, but doesn't have permission! If this was you, Check your config.json" ) ;
await interaction . reply ( client . generateErrorMessage ( 'You do not have permission to run this command.' , interaction . user . displayAvatarURL ( ) ) ) ;
2022-03-26 03:33:18 -05:00
}
}
2022-04-21 18:09:21 -05:00
} ;