community-relations/src/commands/pgp.ts

29 lines
1.1 KiB
TypeScript

import { Message } from 'eris';
import { Client, Command, RichEmbed } from '../class';
import PGP_Upload from './pgp_upload';
import PGP_Remove from './pgp_remove';
export default class PGP extends Command {
constructor(client: Client) {
super(client);
this.name = 'pgp';
this.description = 'Uploads to or removes from your account an PGP public key.';
this.usage = `${this.client.config.prefix}${this.name}`;
this.permissions = 0;
this.guildOnly = true;
this.enabled = true;
this.subcmds = [PGP_Upload, PGP_Remove];
}
public async run(message: Message) {
const profile = await this.client.db.Member.findOne({ userID: message.author.id });
const embed = new RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.dynamicAvatarURL())
.setTitle('PGP Connections')
.setDescription(profile?.pgp ? 'A PGP public key is currently connected to your account.' : 'There are no PGP public keys connected to your account.')
.setTimestamp();
message.channel.createMessage({ embed });
}
}