Skip to content

Commit

Permalink
Remove parameters from file url before processing
Browse files Browse the repository at this point in the history
  • Loading branch information
finr0y committed Oct 21, 2023
1 parent 8949559 commit b6a52cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/events/messageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const event = {
.setDescription("All messages in <#1106383674225725440> must be following these rules:\n* There can only be one attachment on the message, a .zip file\n* The .zip file can only contain one folder named after the game's title ID\n* All save data must be contained within the folder in the root directory")
.setFooter({text: `Your message will be deleted in ${3 * Number(process.env.DELETE_TIME)/1000}s`});
if (message.attachments.size == 1) {
let fileURL = message.attachments.first()!.url;
let fileURL = message.attachments.first()!.url.split("?")[0];
if (fileURL.indexOf("zip", fileURL.length - "zip".length) != -1) {
https.get(fileURL, (res) => {
const filePath = fs.createWriteStream(`${process.cwd()}/savefile.zip`);
Expand Down

0 comments on commit b6a52cc

Please sign in to comment.