Revert changes
parent
45e11803c7
commit
94d6d7fdca
|
@ -1,53 +0,0 @@
|
|||
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[]) {
|
||||
const profile = await this.client.db.Member.findOne({ userID: message.author.id });
|
||||
if (!profile) return this.error(message.channel, 'Please try again later. We do not currently have a member profile for you.');
|
||||
if (!args[1]) return this.error(message.channel, 'No new value was provided.');
|
||||
const newValue = args.slice(1).join(' ');
|
||||
if (newValue.length >= 512) return this.error(message.channel, 'Please shorten your input.');
|
||||
|
||||
switch (args[0]) {
|
||||
case 'github':
|
||||
await profile.updateOne({
|
||||
additional: {
|
||||
...profile.additional,
|
||||
github: args[1],
|
||||
},
|
||||
});
|
||||
this.success(message.channel, 'Updated GitHub.');
|
||||
break;
|
||||
case 'gitlab':
|
||||
await profile.updateOne({
|
||||
additional: {
|
||||
...profile.additional,
|
||||
gitlab: args[1],
|
||||
},
|
||||
});
|
||||
this.success(message.channel, 'Updated GitLab.');
|
||||
break;
|
||||
case 'bio':
|
||||
await profile.updateOne({
|
||||
additional: {
|
||||
...profile.additional,
|
||||
bio: newValue,
|
||||
},
|
||||
});
|
||||
this.success(message.channel, 'Updated bio.');
|
||||
break;
|
||||
default:
|
||||
return this.error(message.channel, 'Please specify a valid option to change.');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -58,17 +58,14 @@ export default class Whois extends Command {
|
|||
if (ackResolve?.extension) {
|
||||
description += `☎️ ${ackResolve.extension}\n`;
|
||||
}
|
||||
|
||||
const memberProfile = await this.client.db.Member.findOne({ userID: message.author.id });
|
||||
|
||||
if (memberProfile?.additional?.gitlab) {
|
||||
description += `${emotes.gitlab} ${memberProfile?.additional.gitlab}\n`;
|
||||
if (ackResolve?.gitlab) {
|
||||
description += `${emotes.gitlab} ${ackResolve?.gitlab}\n`;
|
||||
}
|
||||
if (memberProfile?.additional?.github) {
|
||||
description += `${emotes.github} ${memberProfile?.additional.github}\n`;
|
||||
if (ackResolve?.github) {
|
||||
description += `${emotes.github} ${ackResolve?.github}\n`;
|
||||
}
|
||||
if (memberProfile?.additional?.bio) {
|
||||
description += `${emotes.bio} *${memberProfile?.additional.bio}*\n`;
|
||||
if (ackResolve?.additional?.bio) {
|
||||
description += `${emotes.bio} *${ackResolve?.bio}*\n`;
|
||||
}
|
||||
description += `\n<@${member.id}>`;
|
||||
embed.setDescription(description);
|
||||
|
|
|
@ -5,9 +5,6 @@ export interface MemberInterface extends Document {
|
|||
additional: {
|
||||
langs: ['js', 'py', 'rb', 'ts', 'rs', 'go', 'cfam', 'csharp', 'swift', 'java', 'kt', 'asm'],
|
||||
operatingSystems: ['arch', 'deb', 'cent', 'fedora', 'manjaro', 'mdarwin', 'redhat', 'ubuntu', 'win'],
|
||||
github: string;
|
||||
gitlab: string;
|
||||
bio: string;
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -16,9 +13,6 @@ const Member: Schema = new Schema({
|
|||
additional: {
|
||||
langs: Array,
|
||||
operatingSystems: Array,
|
||||
github: String,
|
||||
gitlab: String,
|
||||
bio: String,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue