presence.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. const presence = new Presence({
  2. clientId: "651406405093425152",
  3. });
  4. let presenceData: PresenceData = {
  5. largeImageKey:
  6. "https://cdn.rcd.gg/PreMiD/websites/L/Legends%20of%20Equestria/assets/logo.png",
  7. };
  8. presence.on("UpdateData", async () => {
  9. if (
  10. document.location.pathname === "/" ||
  11. document.location.pathname === "/home"
  12. )
  13. presenceData.details = "Viewing the homepage";
  14. else if (document.location.pathname.startsWith("/team"))
  15. presenceData.details = "Looking at the team";
  16. else if (document.location.pathname.startsWith("/faq"))
  17. presenceData.details = "Reading the FAQ";
  18. else if (document.location.pathname.startsWith("/rules"))
  19. presenceData.details = "Reading their rules";
  20. else if (document.location.pathname.startsWith("/contact"))
  21. presenceData.details = "Reading the contact informations";
  22. else if (document.location.pathname.startsWith("/downloads"))
  23. presenceData.details = "Looking at the download page";
  24. else {
  25. presenceData = {
  26. largeImageKey:
  27. "https://cdn.rcd.gg/PreMiD/websites/L/Legends%20of%20Equestria/assets/logo.png",
  28. };
  29. }
  30. presence.setActivity(presenceData);
  31. });