community-relations/src/commands/profile.ts

26 lines
1.1 KiB
TypeScript
Raw Normal View History

import { Client, CmdContext, Command } from '../class';
2021-12-23 22:36:13 -05:00
import Profile_Bio from './profile_bio';
import Profile_GitHub from './profile_github';
import Profile_Gitlab from './profile_gitlab';
export default class Profile extends Command {
constructor(client: Client) {
super(client);
this.name = 'profile';
this.description = 'Manages your profile on CR.';
this.usage = `${this.client.config.prefix}profile <bio/github/gitlab> <new value>\n*Provide no value in subcommand to clear data.*`;
this.permissions = 0;
this.enabled = true;
this.subcmds = [Profile_Bio, Profile_GitHub, Profile_Gitlab];
}
public async run(ctx: CmdContext) {
if (!await this.client.db.mongo.Member.exists({ userID: ctx.message.author.id })) {
await this.client.db.mongo.Member.create({ userID: ctx.message.author.id });
2021-12-23 22:36:13 -05:00
}
this.error(ctx.message.channel, `Please specify a valid option to change. Choose from \`github\`, \`bio\` and \`gitlab\`. You can view your profile with \`${this.client.config.prefix}whois\`.`);
2021-12-23 22:36:13 -05:00
}
}