Skip to content

Commit

Permalink
Updated to work with the latest Discord update
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 15, 2023
1 parent 870ace8 commit 1950ac2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ import IDownloadLinkData from "./types/IDownloadLinkData";


function parseDownloadLink(link: string): IDownloadLinkData {
if (link.includes("?")) {
link = link.split("?")[0];
}

const parts = link.split("/");

if (parts[6]) {
if (parts[6].includes("?"))
parts[6] = parts[6].split("?")[0];
}
console.log(parts);

return {
channel_id: parts[4] || "",
message_id: parts[5] || "",
file_name: parts[6] || ""
channel_id: parts[3] || "",
message_id: parts[4] || "",
file_name: parts[5] || ""
};
}

Expand Down

0 comments on commit 1950ac2

Please sign in to comment.