Skip to content

Commit

Permalink
resume commit (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpenguin authored Aug 14, 2022
1 parent b421d72 commit d3f27fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/listeners/messageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const punishSpammersAndTrolls = async (message: Message): Promise<boolean> => {
const convertResumePdfsIntoImages = async (message: Message): Promise<Message<boolean> | undefined> => {
// If no resume pdf is provided, do nothing
const attachments = message.attachments;
if (attachments.size === 0) return;
if (attachments.size !== 1) return;

// Get resume pdf from message and write locally to tmp
const pdfLink = Array.from(attachments.values()).map((file) => file.attachment)[0];
Expand All @@ -84,8 +84,8 @@ const convertResumePdfsIntoImages = async (message: Message): Promise<Message<bo
// Get the size of the pdf
const pdfDocument = await PDFDocument.load(readFileSync('tmp/resume.pdf'));
const { width, height } = pdfDocument.getPage(0).getSize();
if (pdfDocument.getPageCount() > 10) {
return await message.channel.send('Resumes must be less than 10 pages.');
if (pdfDocument.getPageCount() > 1) {
return await message.channel.send('Resume must be 1 page.');
}

// Convert the resume pdf into image
Expand Down

0 comments on commit d3f27fb

Please sign in to comment.