updates to score

pull/29/head
Matthew 2020-09-20 15:24:33 -04:00
parent 98188a4b4b
commit e1e74515f3
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
2 changed files with 2 additions and 1 deletions

View File

@ -155,6 +155,7 @@ export default class Score extends Command {
embed.setFooter(this.client.user.username, this.client.user.avatarURL); embed.setFooter(this.client.user.username, this.client.user.avatarURL);
} }
if (args[1] === 'hard' && this.checkCustomPermissions(this.client.util.resolveMember(message.author.id, this.mainGuild), 6)) { if (args[1] === 'hard' && this.checkCustomPermissions(this.client.util.resolveMember(message.author.id, this.mainGuild), 6)) {
if (score.pin?.length > 0) embed.addField('PIN', score.pin.join('-'), true);
await message.channel.createMessage({ embed }); await message.channel.createMessage({ embed });
await message.channel.createMessage('***===BEGIN ADDITIONAL INFORMATION===***'); await message.channel.createMessage('***===BEGIN ADDITIONAL INFORMATION===***');
await this.client.commands.get('whois').run(message, [user.id]); await this.client.commands.get('whois').run(message, [user.id]);

View File

@ -132,7 +132,7 @@ export default async function calculateScore(client: Client): Promise<NodeJS.Tim
total = Math.floor(((total + activity + roles + moderation + cloudServices + staff + other) * 5.13) * 1.87); total = Math.floor(((total + activity + roles + moderation + cloudServices + staff + other) * 5.13) * 1.87);
await score.updateOne({ $set: { total, activity, roles, moderation, cloudServices, other, staff, lastUpdate: new Date() } }); await score.updateOne({ $set: { total, activity, roles, moderation, cloudServices, other, staff, lastUpdate: new Date() } });
if (!score.pin) { if (!score.pin || score.pin?.length < 1) {
await client.db.Score.updateOne({ userID: member.id }, { $set: { pin: [client.util.randomNumber(100, 999), client.util.randomNumber(10, 99), client.util.randomNumber(1000, 9999)] } }); await client.db.Score.updateOne({ userID: member.id }, { $set: { pin: [client.util.randomNumber(100, 999), client.util.randomNumber(10, 99), client.util.randomNumber(1000, 9999)] } });
} }
// client.util.signale.debug(`SCORE SET - ${member.username}\nTotal: ${total}\nActivity: ${activity}\nRoles: ${roles}\nModeration: ${moderation}\nCloud Services: ${cloudServices}\nStaff: ${staff}`); // client.util.signale.debug(`SCORE SET - ${member.username}\nTotal: ${total}\nActivity: ${activity}\nRoles: ${roles}\nModeration: ${moderation}\nCloud Services: ${cloudServices}\nStaff: ${staff}`);