Revert changes

merge-requests/17/head
Hiroyuki 2021-03-05 21:23:50 -04:00
parent 45e11803c7
commit 94d6d7fdca
No known key found for this signature in database
GPG Key ID: C15AC26538975A24
3 changed files with 6 additions and 68 deletions

View File

@ -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.');
}
}
}

View File

@ -58,17 +58,14 @@ export default class Whois extends Command {
if (ackResolve?.extension) { if (ackResolve?.extension) {
description += `☎️ ${ackResolve.extension}\n`; description += `☎️ ${ackResolve.extension}\n`;
} }
if (ackResolve?.gitlab) {
const memberProfile = await this.client.db.Member.findOne({ userID: message.author.id }); description += `${emotes.gitlab} ${ackResolve?.gitlab}\n`;
if (memberProfile?.additional?.gitlab) {
description += `${emotes.gitlab} ${memberProfile?.additional.gitlab}\n`;
} }
if (memberProfile?.additional?.github) { if (ackResolve?.github) {
description += `${emotes.github} ${memberProfile?.additional.github}\n`; description += `${emotes.github} ${ackResolve?.github}\n`;
} }
if (memberProfile?.additional?.bio) { if (ackResolve?.additional?.bio) {
description += `${emotes.bio} *${memberProfile?.additional.bio}*\n`; description += `${emotes.bio} *${ackResolve?.bio}*\n`;
} }
description += `\n<@${member.id}>`; description += `\n<@${member.id}>`;
embed.setDescription(description); embed.setDescription(description);

View File

@ -5,9 +5,6 @@ export interface MemberInterface extends Document {
additional: { additional: {
langs: ['js', 'py', 'rb', 'ts', 'rs', 'go', 'cfam', 'csharp', 'swift', 'java', 'kt', 'asm'], langs: ['js', 'py', 'rb', 'ts', 'rs', 'go', 'cfam', 'csharp', 'swift', 'java', 'kt', 'asm'],
operatingSystems: ['arch', 'deb', 'cent', 'fedora', 'manjaro', 'mdarwin', 'redhat', 'ubuntu', 'win'], 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: { additional: {
langs: Array, langs: Array,
operatingSystems: Array, operatingSystems: Array,
github: String,
gitlab: String,
bio: String,
}, },
}); });