import { Command, CommandoMessage } from 'discord.js-commando'; module.exports = class MemoryStatsUtility extends Command { constructor(client) { super(client, { name: 'memorystats', aliases: [ 'memstats', 'mem-stats', 'memory-stats', 'memorystats', 'memstat', 'mem-stat', 'memory-stat', 'memorystat' ], group: 'utility', memberName: 'memorystats', description: 'Checks the full, current, approximate memory usage statistics of the bot\'s Node.js process.', }); } run(msg: CommandoMessage) { const used = process.memoryUsage(); msg.reply(`The full, current, approximate memory usage statistics are currentaly; \`\`\`js rss: ${Math.round(used.rss / 1024 / 1024 * 100) / 100} MBs heapTotal: ${Math.round(used.heapTotal / 1024 / 1024 * 100) / 100} MBs heapUsed: ${Math.round(used.heapUsed / 1024 / 1024 * 100) / 100} MBs external: ${Math.round(used.external / 1024 / 1024 * 100) / 100} MBs \`\`\``) } };