pull/29/head
Matthew 2020-09-21 03:33:22 -04:00
parent a209f4c79b
commit 1e1b257460
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 5 additions and 3 deletions

View File

@ -23,6 +23,8 @@ export default class Score extends Command {
const score = await this.client.db.Score.findOne({ userID: member.user.id }).lean().exec();
if (!score) return this.error(message.channel, 'Could not find score report for this user.');
if (score.locked) return this.error(message.channel, 'This user\'s score report is locked.');
const name = args.slice(1).join(' ').split(':')[0];
const dept = args.slice(1).join(' ').split(':')[1];
if (!name || !dept) return this.error(message.channel, 'Invalid arguments.');
@ -36,9 +38,9 @@ export default class Score extends Command {
name,
department: dept,
date: new Date(),
}, this.client.config.internalKey, { expiresIn: '6h' });
await this.client.getDMChannel(member.user.id).then((chan) => {
chan.createMessage(`__**Offer Pre-Approval**__\nYou have been pre-approved for an offer! If you wish to accept this offer, please enter the offer code at https://report.libraryofcode.org/. Do not share this code with anyone else. This offer automatically expires in 6 hours. Your report will be Hard Inquiried immedaitely after accepting this offer.\n\n**Department:** ${dept.toUpperCase()}\n**Offer for:** ${name}\n\n\`${token}\``);
}, this.client.config.internalKey, { expiresIn: '12h' });
this.client.getDMChannel(member.user.id).then((chan) => {
chan.createMessage(`__**Offer Pre-Approval**__\nYou have been pre-approved for an offer! If you wish to accept this offer, please enter the offer code at https://report.libraryofcode.org/. Do not share this code with anyone else. This offer automatically expires in 12 hours. Your report will be Hard Inquiried immediately after accepting this offer.\n\n**Department:** ${dept.toUpperCase()}\n**Offer for:** ${name}\n\n\`${token}\``);
}).catch(() => this.error(message.channel, 'Could not DM member.'));
return this.success(message.channel, `Offer sent.\n\n\`${token}\``);
} catch (err) {