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-23 13:07:50 -05:00
async parseMessage ( client , config , message ) {
2022-07-03 18:12:53 -05:00
await this . handle ( client , config , message . author , message . channel ) ;
2022-04-21 23:44:02 -05:00
} ,
async parseInteraction ( client , config , interaction ) {
2022-07-03 18:12:53 -05:00
await this . handle ( client , config , interaction . user , interaction . channel ) ;
2022-04-21 23:44:02 -05:00
} ,
2022-07-03 18:12:53 -05:00
async handle ( client , config , user , channel ) {
2022-08-02 23:53:10 -05:00
if ( user . id === process . env . OWNERID ) {
2022-07-03 18:12:53 -05:00
console . log ( '[SYSTEM] [INFO] ' + ` The bot is going down for shut down. \n Shutdown requested by ${ user . username } ` ) ;
await channel . send ( {
2022-04-21 18:09:21 -05:00
embeds : [ {
2022-12-26 16:28:19 -06:00
title : 'Shut down the bot' ,
description : '<a:AnitroxWorking:997565411212144730> Shutting down now, Until next time!' ,
2022-04-21 18:09:21 -05:00
color : 9442302 ,
footer : {
2022-04-21 23:44:02 -05:00
icon _url : 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-07-01 19:34:46 -05:00
console . error ( '[SYSTEM] [ERR] User ' + user . username + " tried to shut down the bot, but doesn't have permission! If this was you, Check your config.json" ) ;
2022-07-03 18:12:53 -05:00
await channel . send ( client . generateErrorMessage ( 'You do not have permission to run this command.' , user . displayAvatarURL ( ) ) ) ;
2022-03-26 03:33:18 -05:00
}
}
2022-04-21 18:09:21 -05:00
} ;