123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- const presence = new Presence({
- clientId: "846071986902925312",
- }),
- browsingTimestamp = Math.floor(Date.now() / 1000);
- presence.on("UpdateData", async () => {
- const presenceData: PresenceData = {
- largeImageKey:
- "https://cdn.rcd.gg/PreMiD/websites/N/Nekopost/assets/logo.png",
- startTimestamp: browsingTimestamp,
- };
- if (document.location.pathname.includes("/manga")) {
- if (document.location.pathname.includes("/manga/")) {
- if (document.querySelector("head > title").textContent.includes("Ch")) {
- presenceData.details = `Manga :${
- document.querySelector("head > title").textContent.split("-")[1]
- }!`;
- presenceData.state = document
- .querySelector("head > title")
- .textContent.split(" ")[0];
- presenceData.smallImageKey = Assets.Reading;
- } else {
- presenceData.details = `Manga :${
- document.querySelector("head > title").textContent
- }!`;
- presenceData.smallImageKey = Assets.Search;
- }
- } else {
- presenceData.details = "กำลังเลือก Manga";
- presenceData.smallImageKey = Assets.Search;
- }
- } else if (document.location.pathname.includes("/novel")) {
- if (document.location.pathname.includes("/novel/")) {
- if (document.querySelector("head > title").textContent.includes("Ch")) {
- presenceData.details = `Novel :${
- document.querySelector("head > title").textContent.split("-")[1]
- }!`;
- presenceData.state = document
- .querySelector("head > title")
- .textContent.split(" ")[0];
- presenceData.smallImageKey = Assets.Reading;
- } else {
- presenceData.details = `Novel :${
- document.querySelector("head > title").textContent
- }!`;
- presenceData.smallImageKey = Assets.Search;
- }
- } else {
- presenceData.details = "กำลังเลือก Novel";
- presenceData.smallImageKey = Assets.Search;
- }
- } else if (document.location.pathname.includes("/comic")) {
- if (document.location.pathname.includes("/comic/")) {
- if (document.querySelector("head > title").textContent.includes("Ch")) {
- presenceData.details = `Comic :${
- document.querySelector("head > title").textContent.split("-")[1]
- }!`;
- presenceData.state = document
- .querySelector("head > title")
- .textContent.split(" ")[0];
- presenceData.smallImageKey = Assets.Reading;
- } else {
- presenceData.details = `Comic :${
- document.querySelector("head > title").textContent
- }!`;
- presenceData.smallImageKey = Assets.Search;
- }
- } else {
- presenceData.details = "กำลังเลือก Original Comic";
- presenceData.smallImageKey = Assets.Search;
- }
- } else if (document.location.pathname.includes("/fiction")) {
- if (document.location.pathname.includes("/fiction/")) {
- if (document.querySelector("head > title").textContent.includes("Ch")) {
- presenceData.details = `ONovel :${
- document.querySelector("head > title").textContent.split("-")[1]
- }!`;
- presenceData.state = document
- .querySelector("head > title")
- .textContent.split(" ")[0];
- presenceData.smallImageKey = Assets.Reading;
- } else {
- presenceData.details = `ONovel :${
- document.querySelector("head > title").textContent
- }!`;
- presenceData.smallImageKey = Assets.Search;
- }
- } else {
- presenceData.details = "กำลังเลือก Original Novel";
- presenceData.smallImageKey = Assets.Search;
- }
- } else if (document.location.pathname.includes("/explore")) {
- presenceData.details = "กำลังเลือก Project";
- presenceData.smallImageKey = Assets.Search;
- } else if (document.location.pathname === "/") {
- presenceData.details = "กำลังหา...";
- presenceData.smallImageKey = Assets.Search;
- }
- presence.setActivity(presenceData);
- });
|