fixes
parent
a209f4c79b
commit
1e1b257460
|
@ -23,6 +23,8 @@ export default class Score extends Command {
|
||||||
const score = await this.client.db.Score.findOne({ userID: member.user.id }).lean().exec();
|
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) 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 name = args.slice(1).join(' ').split(':')[0];
|
||||||
const dept = args.slice(1).join(' ').split(':')[1];
|
const dept = args.slice(1).join(' ').split(':')[1];
|
||||||
if (!name || !dept) return this.error(message.channel, 'Invalid arguments.');
|
if (!name || !dept) return this.error(message.channel, 'Invalid arguments.');
|
||||||
|
@ -36,9 +38,9 @@ export default class Score extends Command {
|
||||||
name,
|
name,
|
||||||
department: dept,
|
department: dept,
|
||||||
date: new Date(),
|
date: new Date(),
|
||||||
}, this.client.config.internalKey, { expiresIn: '6h' });
|
}, this.client.config.internalKey, { expiresIn: '12h' });
|
||||||
await this.client.getDMChannel(member.user.id).then((chan) => {
|
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}\``);
|
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.'));
|
}).catch(() => this.error(message.channel, 'Could not DM member.'));
|
||||||
return this.success(message.channel, `Offer sent.\n\n\`${token}\``);
|
return this.success(message.channel, `Offer sent.\n\n\`${token}\``);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue