info command
parent
4bf2311091
commit
0308e20528
|
@ -0,0 +1,34 @@
|
|||
import { Message } from 'eris';
|
||||
import { totalmem } from 'os';
|
||||
import { Client, Command, RichEmbed } from '../class';
|
||||
import { version as erisVersion } from '../../node_modules/eris/package.json';
|
||||
import { version as mongooseVersion } from '../../node_modules/mongoose/package.json';
|
||||
|
||||
export default class Info extends Command {
|
||||
constructor(client: Client) {
|
||||
super(client);
|
||||
this.name = 'info';
|
||||
this.description = 'System information.';
|
||||
this.usage = 'info';
|
||||
this.permissions = 0;
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public async run(message: Message) {
|
||||
try {
|
||||
const embed = new RichEmbed();
|
||||
embed.setTitle('Information');
|
||||
embed.setThumbnail(this.client.user.avatarURL);
|
||||
embed.addField('Language(s)', '<:TypeScript:703451285789343774> TypeScript', true);
|
||||
embed.addField('Discord Library', `Eris (${erisVersion})`, true);
|
||||
embed.addField('Database Library', `MongoDB w/ Mongoose ODM (${mongooseVersion})`, true);
|
||||
embed.addField('Repository', 'https://gitlab.libraryofcode.org/engineering/communityrelations | Licensed under GNU Affero General Public License V3', true);
|
||||
embed.addField('Memory Usage', `${Math.round(process.memoryUsage().rss / 1024 / 1024)} MB / ${Math.round(totalmem() / 1024 / 1024 / 1024)} GB`, true);
|
||||
embed.setFooter(this.client.user.username, this.client.user.avatarURL);
|
||||
embed.setTimestamp();
|
||||
message.channel.createMessage({ embed });
|
||||
} catch (err) {
|
||||
this.client.util.handleError(err, message, this);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue