2019-09-15 04:22:29 +00:00
const client = require ( "../utils/client.js" ) ;
2019-12-07 02:04:17 +00:00
const { version } = require ( "../package.json" ) ;
2019-09-15 04:22:29 +00:00
const moment = require ( "moment" ) ;
require ( "moment-duration-format" ) ;
const os = require ( "os" ) ;
2020-07-02 15:33:27 +00:00
exports . run = async ( ) => {
2019-09-15 04:22:29 +00:00
const duration = moment . duration ( client . uptime ) . format ( " D [days], H [hrs], m [mins], s [secs]" ) ;
const embed = {
embed : {
"author" : {
"name" : "esmBot Statistics" ,
"icon_url" : client . user . avatarURL
} ,
"color" : 16711680 ,
2019-12-09 20:52:33 +00:00
"description" : process . env . NODE _ENV === "development" ? "**You are currently using esmBot Dev! Things may change at any time without warning and there will be bugs. Many bugs.**" : "" ,
2019-09-15 04:22:29 +00:00
"fields" : [ {
2019-12-07 02:04:17 +00:00
"name" : "Version" ,
2019-12-09 20:52:33 +00:00
"value" : ` v ${ version } ${ process . env . NODE _ENV === "development" ? "-dev" : "" } `
2019-12-07 02:04:17 +00:00
} ,
{
2019-09-15 04:22:29 +00:00
"name" : "Memory Usage" ,
"value" : ` ${ ( process . memoryUsage ( ) . heapUsed / 1024 / 1024 ) . toFixed ( 2 ) } MB `
} ,
{
"name" : "Uptime" ,
"value" : duration
} ,
{
"name" : "Host" ,
"value" : ` ${ os . type ( ) } ${ os . release ( ) } ( ${ os . arch ( ) } ) `
} ,
{
"name" : "Library" ,
"value" : ` Eris ${ require ( "eris" ) . VERSION } `
} ,
{
"name" : "Node.js Version" ,
"value" : process . version
}
]
}
} ;
2020-04-12 19:51:48 +00:00
return embed ;
2019-11-15 16:59:50 +00:00
} ;
2019-12-02 20:47:22 +00:00
exports . aliases = [ "status" , "stat" ] ;
exports . category = 1 ;
exports . help = "Gets some statistics about me" ;