From 8c55efd7e37f9a0c489360282d434c76b5272252 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 28 Oct 2020 21:02:03 -0400 Subject: [PATCH] fixes --- src/commands/score.ts | 6 +++--- src/commands/whois.ts | 13 ++++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/commands/score.ts b/src/commands/score.ts index 1b570af..e333ae2 100644 --- a/src/commands/score.ts +++ b/src/commands/score.ts @@ -92,7 +92,7 @@ export default class Score extends Command { const mem = this.client.util.resolveMember(score.userID, this.client.guilds.get(this.client.config.guildID)); embed.addField('Member', `${mem.user.username}#${mem.user.discriminator} | <@${score.userID}>`, true); embed.addField('Type', 'HARD', true); - embed.addField('Department/Service', name, true); + embed.addField('Department/Service', name.toUpperCase(), true); embed.addField('Reason', reason ?? 'N/A', true); embed.setTimestamp(); embed.setFooter(this.client.user.username, this.client.user.avatarURL); @@ -151,7 +151,7 @@ export default class Score extends Command { } const percentile = this.client.util.percentile(set, score.total); const embed = new RichEmbed(); - embed.setTitle('Community Score'); + embed.setTitle('Community Report'); embed.setAuthor(user.username, user.avatarURL); embed.setThumbnail(user.avatarURL); /* for (const role of member.roles.map((r) => this.mainGuild.roles.get(r)).sort((a, b) => b.position - a.position)) { @@ -176,7 +176,7 @@ export default class Score extends Command { if (score.total >= 630) { color = '🟡'; additionalText = 'GOOD'; embed.setColor('FFFF00'); } if (score.total >= 700) { color = '🟢'; additionalText = 'EXCELLENT'; embed.setColor('66FF66'); } if (score.total >= 770) { color = '✨'; additionalText = 'EXCEPTIONAL'; embed.setColor('#99FFFF'); } - embed.addField('Total | 200 to 800', score ? `${color} ${totalScore} | ${additionalText} | ${this.client.util.ordinal(Math.round(percentile))} Percentile` : 'N/C', true); + embed.addField('CommScore™ | 200 to 800', score ? `${color} ${totalScore} | ${additionalText} | ${this.client.util.ordinal(Math.round(percentile))} Percentile` : 'N/C', true); embed.addField(`Activity | 10 to ${Math.floor(Math.log1p(3000 + 300 + 200 + 100) * 12)}`, activityScore || 'N/C', true); embed.addField('Roles | 1 to N/A', roleScore || 'N/C', true); embed.addField('Moderation | N/A to 2' || 'N/C', moderationScore, true); diff --git a/src/commands/whois.ts b/src/commands/whois.ts index eab6181..fb2dd3e 100644 --- a/src/commands/whois.ts +++ b/src/commands/whois.ts @@ -1,6 +1,6 @@ /* eslint-disable no-bitwise */ import moment from 'moment'; -import { Message, Member } from 'eris'; +import { Message, Member, TextChannel } from 'eris'; import { Client, Command, RichEmbed } from '../class'; // import acknowledgements from '../configs/acknowledgements.json'; import { whois as emotes } from '../configs/emotes.json'; @@ -81,6 +81,17 @@ export default class Whois extends Command { const score = await this.client.db.Score.findOne({ userID: member.id }); if (score) { await this.client.db.Score.updateOne({ userID: member.id }, { $addToSet: { softInquiries: { name: 'Library of Code sp-us | Bureau of Community Reports', date: new Date() } } }); + const embed2 = new RichEmbed(); + embed2.setTitle('Inquiry Notification'); + embed2.setColor('#00FFFF'); + const mem = this.client.util.resolveMember(score.userID, this.client.guilds.get(this.client.config.guildID)); + embed2.addField('Member', `${mem.user.username}#${mem.user.discriminator} | <@${score.userID}>`, true); + embed2.addField('Type', 'SOFT', true); + embed2.addField('Department/Service', 'Library of Code sp-us | Bureau of Community Reports'.toUpperCase(), true); + embed2.setTimestamp(); + embed2.setFooter(this.client.user.username, this.client.user.avatarURL); + const log = this.client.guilds.get(this.client.config.guildID).channels.get('611584771356622849'); + log.createMessage({ embed: embed2 }).catch(() => {}); let totalScore = '0'; if (score.total < 200) totalScore = '---'; else if (score.total > 800) totalScore = '800';