Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactored verify to add one point with one less DB call
  • Loading branch information
MikeSewell committed Mar 17, 2018
commit 477f48797fa206f8ab975db921d238d0f216f8c2
7 changes: 1 addition & 6 deletions bot/controllers/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,7 @@ class VerifyController extends BaseController {
const emailType = 'verify';
const emailSubject = 'Armada Verification Code';
const emailBodyString = `<table><tr><td><p>Enter the code below into Discord, in the same channel on the Armada Server. Verification will timeout after ${(timeoutInMiliseconds / 1000) / 60} minutes from first entering the !verify command.</p></td></tr><tr><td><h2>Verification Code: ${code}</h2></td></tr></table>`;
sendEmail(message, email, emailSubject, emailBodyString, emailType, (sendStatus) => {
if (sendStatus) {
const numPointToAdd = 1;
getUserPointsandUpdate(message.author.id, numPointToAdd);
}
});
sendEmail(message, email, emailSubject, emailBodyString, emailType, sendStatus => sendStatus);

util.log('Code', code, 3);
return `...What's the passcode? \n\n *eyes you suspicously*\n\n I just sent it to your email, just respond back to this channel within ${(timeoutInMiliseconds / 1000) / 60} minutes, with the code, and I won't treat you like a scurvy cur!`;
Expand Down