2019-09-13 20:02:41 +00:00
const client = require ( "../utils/client.js" ) ;
2020-08-13 13:47:41 +00:00
const regex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/ig ;
2019-09-13 20:02:41 +00:00
exports . run = async ( message , args ) => {
if ( args . length !== 0 ) {
2020-08-13 13:47:41 +00:00
if ( regex . test ( args . join ( " " ) ) ) return ` ${ message . author . mention } , you can't send a message containing a URL. If you want to report an issue, please join the esmBot Support server instead. ` ;
2019-09-13 20:02:41 +00:00
const feedbackChannel = client . guilds . get ( "592399417676529688" ) . channels . get ( "592429860769497098" ) ;
feedbackChannel . createMessage ( {
embed : {
color : 16711680 ,
timestamp : new Date ( ) ,
thumbnail : {
url : message . author . avatarURL
} ,
author : {
name : "esmBot Feedback" ,
icon _url : client . user . avatarURL
} ,
fields : [ {
name : "👥 Author:" ,
value : ` ${ message . author . username } # ${ message . author . discriminator } `
} , {
name : "👪 Server:" ,
2020-09-01 22:10:19 +00:00
value : message . channel . guild ? message . channel . guild . name : "N/A"
2019-09-13 20:02:41 +00:00
} , {
name : "💬 Message:" ,
value : args . join ( " " )
} ]
}
} ) ;
return ` ${ message . author . mention } , your feedback has been sent! ` ;
} else {
return ` ${ message . author . mention } , you need to provide some feedback to send! ` ;
}
} ;
exports . aliases = [ "request" , "report" , "complain" , "compliment" ] ;
2019-12-02 20:47:22 +00:00
exports . category = 1 ;
2019-12-05 16:58:46 +00:00
exports . help = "Leaves some feedback for the bot owner" ;
exports . params = "[message]" ;