22 lines
785 B
TypeScript
22 lines
785 B
TypeScript
|
import { Message } from 'eris';
|
||
|
import { Client, Command } from '../class';
|
||
|
|
||
|
export default class Profile extends Command {
|
||
|
constructor(client: Client) {
|
||
|
super(client);
|
||
|
this.name = 'profile';
|
||
|
this.description = 'Manages your profile on CR';
|
||
|
this.usage = 'profile <bio/github/gitlab> <new value>';
|
||
|
this.permissions = 0;
|
||
|
this.enabled = true;
|
||
|
}
|
||
|
|
||
|
public async run(message: Message, args: string[]) {
|
||
|
if (!await this.client.db.Member.exists({ userID: message.author.id })) {
|
||
|
await this.client.db.Member.create({ userID: message.author.id });
|
||
|
}
|
||
|
|
||
|
this.error(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\`.`);
|
||
|
}
|
||
|
}
|