Skip to content

Commit

Permalink
Add GAMEE presence (PreMiD#4115)
Browse files Browse the repository at this point in the history
* Add paimon.moe presence

* [CodeFactor] Apply fixes to commit a13bd9b

* change color for metadata

* [CodeFactor] Apply fixes

* minor changes

* minor changes

* [CodeFactor] Apply fixes to commit ff5bc41

* overwrite idk

* [CodeFactor] Apply fixes to commit b30f4dd

* added presence for global wish tally

* [CodeFactor] Apply fixes

* array destructuring

* [CodeFactor] Apply fixes

* Update paimon.moe presence

* Update paimon.moe presence

* Update presence.ts

* ririxi said not to check url so i have no choice

* [CodeFactor] Apply fixes to commit 150062c

* a

* Update paimon.moe presence

* a

* a

* a

* Add osu!track presence

* [CodeFactor] Apply fixes to commit 2b37ae4

* Delete websites/O/osu!track directory

* Add osu!track presence

* Update metadata.json

Change author username

* Update presence.ts

* [CodeFactor] Apply fixes

* Delete websites/O/osu!track directory

* Add GAMEE presence

* Delete websites/P/paimon.moe directory

* Update presence.ts

* [CodeFactor] Apply fixes

* update

* [CodeFactor] Apply fixes to commit 73c04f0

* Update websites/G/GAMEE/presence.ts

Co-authored-by: Slowlife <[email protected]>

* Update metadata.json

* idk what happened here

* unbump version lol

Co-authored-by: Jayden Koh Jia Jian <[email protected]>
Co-authored-by: codefactor-io <[email protected]>
Co-authored-by: Slowlife <[email protected]>
  • Loading branch information
4 people authored Jul 19, 2021
1 parent dfef168 commit 0590555
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 0 deletions.
25 changes: 25 additions & 0 deletions websites/G/GAMEE/dist/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://schemas.premid.app/metadata/1.3",
"service": "GAMEE",
"author": {
"name": "rushia",
"id": "398752205043400724"
},
"category": "games",
"logo": "https://i.imgur.com/kJCKhkE.png",
"thumbnail": "https://i.imgur.com/cUAhgyh.png",
"version": "1.0.0",
"color": "#afee70",
"tags": [
"paid-to-play",
"play-to-win",
"play-to-win-real-money",
"games",
"cash",
"prizes"
],
"url": "www.gamee.com",
"description": {
"en": "Play games, get tickets and WIN $$$. More tickets, more chances to WIN!"
}
}
69 changes: 69 additions & 0 deletions websites/G/GAMEE/presence.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
const presence = new Presence({
clientId: "865212562130862120"
}),
timer = Math.floor(Date.now() / 1000);

presence.on("UpdateData", async () => {
const presenceData: PresenceData = {
largeImageKey: "gamee_logo",
startTimestamp: timer
},

{pathname, href} = location,
[, , IDs] = pathname.split("/");

if (pathname === "/")
presenceData.details = "Viewing homepage";
else if (pathname.includes("/prizes"))
presenceData.details = "Viewing the prizes";
else if (pathname.includes("/winners"))
presenceData.details = "Viewing the winners";
else if (pathname.includes("/create-profile"))
presenceData.details = "Creating an account";
else if (pathname.includes("/login"))
presenceData.details = "Logg ing In";
else if (pathname.includes("/phone-login"))
presenceData.details = "Logging in with a phone number";
else if (pathname.includes("/reset-password"))
presenceData.details = "Resetting a password";
else if (pathname === "/contest" || pathname === "/contest/")
presenceData.details = "Viewing Contest Page";
else if (pathname.includes("/contest-rules")) {
presenceData.details = "Reading the contest rules";
presenceData.smallImageKey = "reading";
presenceData.smallImageText = "Reading";
} else if (pathname.includes("/squad"))
presenceData.details = "Viewing the squad";
else if (pathname.includes("/terms-of-use")) {
presenceData.details = "Reading the Terms Of Service";
presenceData.smallImageKey = "reading";
presenceData.smallImageText = "Reading";
} else if (pathname.includes("/privacy")) {
presenceData.details = "Reading the Privacy Policy";
presenceData.smallImageKey = "reading";
presenceData.smallImageText = "Reading";
} else if (pathname.includes(`/profile/${IDs}`)) {
const name = document.querySelector("#root > div.layout.layout--with-tab-bar.layout__profile-page > div.profile-page__container > div.profile-header > h1");

presenceData.details = "Viewing a user's profile:";
presenceData.state = name.textContent;
presenceData.buttons = [
{
label: `View ${name.textContent}'s profile`,
url: href
}
];
} else if (pathname.includes(`/game/${IDs}`)) {
const gameName = document.querySelector("#root > div.game-page > div.game-detail > div.game-bar > div.game-bar__slot.game-bar__slot--left > h3");

presenceData.details = "Playing a game:";
presenceData.state = gameName.textContent;
}

if (!presenceData.details) {
presence.setTrayTitle();
presence.setActivity();
} else
presence.setActivity(presenceData);

});
6 changes: 6 additions & 0 deletions websites/G/GAMEE/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist/"
}
}

0 comments on commit 0590555

Please sign in to comment.