Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.run = async (bot, message, args) => {
const cpuUsage = (await cpu.usage()) + "%";
const memoryUsage = (await mem.info()).freeMemMb + "MB";
// prettier-ignore
const operatingSystem = `${os.type()} ${await os.oos().then(o => o)} ${os.arch()}`;
// prettier-ignore
const embed = new Discord.MessageEmbed()
.setAuthor(`About me`, "", "https://github.com/shidoitsuka/another-miku-bot")
.setThumbnail("https://tinyurl.com/MikuLogo")
.setColor(0x1a9ca8)
.setDescription("Hello, I'm Miku!\nA `just4fun` discord bot written over discord.js framework with ❤ by 12042#5754.")
.addField("NodeJS version:", `${process.version.slice(1).split(".").join(".")}`, true)
.addField("discord.js version:", `${package.dependencies["discord.js"]}`, true)
.addField("Executed Command(s):", bot.db.get("totalCommands"), true)
.addField("CPU Usage:", cpuUsage, true)
.addField("Memory Usage:", memoryUsage, true)
.addField("OS Info:", operatingSystem, true)
.addField("Invite link:", "[Click Me!](https://discordapp.com/oauth2/authorize/?permissions=2080898303&scope=bot&client_id=364242246314360843)", true)
exports.run = async (bot, message, args) => {
const cpuUsage = (await cpu.usage()) + "%";
const memoryUsage = (await mem.info()).freeMemMb + "MB";
// prettier-ignore
const operatingSystem = `${os.type()} ${await os.oos().then(o => o)} ${os.arch()}`;
// prettier-ignore
const embed = new Discord.MessageEmbed()
.setAuthor(`About me`, "", "https://github.com/shidoitsuka/another-miku-bot")
.setThumbnail("https://tinyurl.com/MikuLogo")
.setColor(0x1a9ca8)
.setDescription("Hello, I'm Miku!\nA `just4fun` discord bot written over discord.js framework with ❤ by 12042#5754.")
.addField("NodeJS version:", `${process.version.slice(1).split(".").join(".")}`, true)
.addField("discord.js version:", `${package.dependencies["discord.js"]}`, true)
.addField("Executed Command(s):", bot.db.get("totalCommands"), true)
.addField("CPU Usage:", cpuUsage, true)
.addField("Memory Usage:", memoryUsage, true)
.addField("OS Info:", operatingSystem, true)
.addField("Invite link:", "[Click Me!](https://discordapp.com/oauth2/authorize/?permissions=2080898303&scope=bot&client_id=364242246314360843)", true)
.addField("Fan server is here!!", "[Click Me!](https://discord.gg/uxseTvy)", true)
exports.run = async (bot, message, args) => {
const cpuUsage = (await cpu.usage()) + "%";
const memoryUsage = (await mem.info()).freeMemMb + "MB";
// prettier-ignore
const operatingSystem = `${os.type()} ${await os.oos().then(o => o)} ${os.arch()}`;
// prettier-ignore
const embed = new Discord.MessageEmbed()
.setAuthor(`About me`, "", "https://github.com/shidoitsuka/another-miku-bot")
.setThumbnail("https://tinyurl.com/MikuLogo")
.setColor(0x1a9ca8)
.setDescription("Hello, I'm Miku!\nA `just4fun` discord bot written over discord.js framework with ❤ by 12042#5754.")
.addField("NodeJS version:", `${process.version.slice(1).split(".").join(".")}`, true)
.addField("discord.js version:", `${package.dependencies["discord.js"]}`, true)
.addField("Executed Command(s):", bot.db.get("totalCommands"), true)
.addField("CPU Usage:", cpuUsage, true)
.addField("Memory Usage:", memoryUsage, true)
.addField("OS Info:", operatingSystem, true)
.addField("Invite link:", "[Click Me!](https://discordapp.com/oauth2/authorize/?permissions=2080898303&scope=bot&client_id=364242246314360843)", true)
.addField("Fan server is here!!", "[Click Me!](https://discord.gg/uxseTvy)", true)
.setFooter(`Click title for my source-code | v${package.version}-beta`);
message.channel.send({ embed });
static async getServer (ctx) {
// cpu stat
let cpu = osu.cpu
let cpuUsage = await cpu.usage()
let cpuAverage = await cpu.average()
// mem stat
let mem = osu.mem
let memInfo = await mem.info()
ctx.status = 200
ctx.body = {
success: true,
message: "获取服务器信息",
data: {
cpu: {
cpuUsage,
cpuAverage
},
static async getServer (ctx) {
// cpu stat
let cpu = osu.cpu
let cpuUsage = await cpu.usage()
let cpuAverage = await cpu.average()
// mem stat
let mem = osu.mem
let memInfo = await mem.info()
ctx.status = 200
ctx.body = {
success: true,
message: "获取服务器信息",
data: {
cpu: {
cpuUsage,
cpuAverage
},
mem: {
memInfo
}
}
}
const cpuInfo = async () => {
const coreCount = cpu.count()
const cpuPercent = round(await cpu.usage())
let loadAverage = ''
cpu.loadavg().forEach((i) => (loadAverage += `${round(i)}% `))
return { cores: coreCount, percentage: cpuPercent, load: loadAverage.trim() }
}
const cpuInfo = async () => {
const coreCount = cpu.count()
const cpuPercent = round(await cpu.usage())
let loadAverage = ''
cpu.loadavg().forEach((i) => (loadAverage += `${round(i)}% `))
return { cores: coreCount, percentage: cpuPercent, load: loadAverage.trim() }
}
const cpuInfo = async () => {
const coreCount = cpu.count()
const cpuPercent = round(await cpu.usage())
let loadAverage = ''
cpu.loadavg().forEach((i) => (loadAverage += `${round(i)}% `))
return { cores: coreCount, percentage: cpuPercent, load: loadAverage.trim() }
}