Skip to content

Commit

Permalink
Merge pull request #500 from uwcsc/issue#-496
Browse files Browse the repository at this point in the history
Fix Issue #496 - Threads not created automatically for resume reviews
  • Loading branch information
Fan-Yang-284 authored Oct 28, 2023
2 parents 7c387a8 + f92e51c commit a07018d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/events/messageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ const convertResumePdfsIntoImages = async (
}

const fileMatch = pdfLink.match('[^/]*$') || ['Resume'];
const fileName = fileMatch[0];
// Remove url parameters by calling `.split(?)[0]`
const fileName = fileMatch[0].split('?')[0];
// Convert the resume pdf into image
const imgResponse = await convertPdfToPic(PDF_FILE_PATH, 'resume', width * 2, height * 2);
// Send the image back to the channel as a thread
const thread = await message.startThread({
name: `${fileName}`,
name: fileName.length < 100 ? fileName : 'Resume',
autoArchiveDuration: 60,
});
const preview_message = await thread.send({
Expand Down

0 comments on commit a07018d

Please sign in to comment.