From 8a2c9df3fd75a08d2b4acabe0b3a6bd62da22b34 Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Thu, 23 Apr 2020 19:06:09 -0700 Subject: shift groups around, new mod cmds, v7.5.0 --- src/commands/bot/memoryusage.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/commands/bot/memoryusage.ts (limited to 'src/commands/bot/memoryusage.ts') diff --git a/src/commands/bot/memoryusage.ts b/src/commands/bot/memoryusage.ts new file mode 100644 index 0000000..545edd5 --- /dev/null +++ b/src/commands/bot/memoryusage.ts @@ -0,0 +1,27 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import emoji from 'emoji-random'; + +module.exports = class MemoryUsageBot extends Command { + constructor(client) { + super(client, { + name: 'memoryusage', + aliases: [ + 'memusage', + 'mem-usage', + 'memory-usage', + 'mem', + 'memory', + 'memoryusage' + ], + group: 'bot', + memberName: 'memoryusage', + description: 'Checks the current, approximate memory usage of the bot\'s Node.js process.', + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] + }); + } + run(msg: CommandoMessage) { + const used = process.memoryUsage().heapUsed / 1024 / 1024; + msg.reply(`The current, approximate memory usage is currently **${Math.round(used * 100) / 100}** MBs. ${emoji.random()}`) + } +}; \ No newline at end of file -- cgit v1.2.3