Skip to content

Commit a07018d

Browse files
authored
Merge pull request #500 from uwcsc/issue#-496
Fix Issue #496 - Threads not created automatically for resume reviews
2 parents 7c387a8 + f92e51c commit a07018d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/events/messageCreate.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,13 @@ const convertResumePdfsIntoImages = async (
9898
}
9999

100100
const fileMatch = pdfLink.match('[^/]*$') || ['Resume'];
101-
const fileName = fileMatch[0];
101+
// Remove url parameters by calling `.split(?)[0]`
102+
const fileName = fileMatch[0].split('?')[0];
102103
// Convert the resume pdf into image
103104
const imgResponse = await convertPdfToPic(PDF_FILE_PATH, 'resume', width * 2, height * 2);
104105
// Send the image back to the channel as a thread
105106
const thread = await message.startThread({
106-
name: `${fileName}`,
107+
name: fileName.length < 100 ? fileName : 'Resume',
107108
autoArchiveDuration: 60,
108109
});
109110
const preview_message = await thread.send({

0 commit comments

Comments
 (0)