forked from PreMiD/Presences
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into revert-2051-revert-2049-dp1
- Loading branch information
Showing
21 changed files
with
990 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"$schema": "https://schemas.premid.app/metadata/1.0", | ||
"author": { | ||
"name": "MrLivixx", | ||
"id": "502948927809781763" | ||
}, | ||
"url": [ | ||
"docs.juniper.bot", | ||
"feedback.juniper.bot", | ||
"juniper.bot" | ||
], | ||
"description": { | ||
"ru": "Многофункциональный, полностью настраиваемый бот для платформы Discord, с панелью управления.", | ||
"en": "Fluffy Discord Bot (Music, Ranking, Reminder, Vk Community bridge, WikiFur)" | ||
}, | ||
"service": "Juniperbot", | ||
"version": "1.0.0", | ||
"logo": "https://i.imgur.com/YYk1v1F.png", | ||
"thumbnail": "https://i.imgur.com/XOcpBkV.png", | ||
"color": "#C27C0E", | ||
"tags": [ | ||
"bot", | ||
"discord", | ||
"juniper", | ||
"juniperbot" | ||
], | ||
"category": "other", | ||
"settings": [ | ||
{ | ||
"id": "juniper", | ||
"title": "To display the status of actions on juniper.bot", | ||
"icon":"fas fa-lightbulb", | ||
"value": true | ||
}, | ||
{ | ||
"id": "docs", | ||
"title": "To display the status of actions on docs.juniper.bot", | ||
"icon":"fas fa-lightbulb", | ||
"value": true | ||
}, | ||
{ | ||
"id": "fback", | ||
"title": "To display the status of actions on feedback.juniper.bot", | ||
"icon":"fas fa-lightbulb", | ||
"value": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const | ||
presence = new Presence({clientId: "739908991274057870"}), | ||
browsingStamp = Math.floor(Date.now() / 1000); | ||
|
||
presence.on("UpdateData", async () => { | ||
const presenceData: PresenceData = {largeImageKey: "logo"}, | ||
juniper: boolean = await presence.getSetting("juniper"), | ||
docs: boolean = await presence.getSetting("docs"), | ||
fback: boolean = await presence.getSetting("fback"); | ||
|
||
if (document.location.hostname == "juniper.bot") { | ||
if(juniper){ | ||
presenceData.startTimestamp = browsingStamp; | ||
if (document.location.pathname.includes("/ranking")) { | ||
presenceData.details = "Looks at the server's leaderboard:"; | ||
presenceData.state = document.querySelector(".guild--info h1.font-weight-thin.display-2").innerHTML; | ||
presenceData.smallImageKey = "list"; | ||
} else if (document.location.pathname.includes("/dashboard/")) { | ||
presenceData.details = "In dashboard"; | ||
presenceData.state = `Guild: ${document.querySelector(".guild--info h1.font-weight-thin.display-2").innerHTML}`; | ||
} else if (document.location.pathname.includes("/donate")) { | ||
presenceData.details = "Reads information about the donation"; | ||
presenceData.smallImageKey = "donate"; | ||
} else if (document.location.pathname == "/") { | ||
presenceData.details = "Main page"; | ||
} else if (document.location.pathname == "/servers"){ | ||
presenceData.details = "Selects the server"; | ||
presenceData.smallImageKey = "list"; | ||
} else if (document.location.pathname == "/commands"){ | ||
presenceData.details = "Looks at the list of commands"; | ||
presenceData.smallImageKey = "list"; | ||
} else if (document.location.pathname == "/status"){ | ||
presenceData.details = "Looks at the bot's statistics"; | ||
presenceData.smallImageKey = "stats"; | ||
} else if (document.location.pathname == "/user/card"){ | ||
presenceData.details = "Changes the rank card"; | ||
} | ||
} | ||
} else if(docs){ | ||
if (document.location.hostname == "docs.juniper.bot") { | ||
presenceData.startTimestamp = browsingStamp; | ||
presenceData.details = document.title; | ||
presenceData.state = "docs.juniper.bot"; | ||
presenceData.smallImageKey = "list"; | ||
} | ||
} else if(fback){ | ||
if (document.location.hostname == "feedback.juniper.bot"){ | ||
presenceData.startTimestamp = browsingStamp; | ||
presenceData.state = "feedback.juniper.bot"; | ||
if (document.location.pathname == "/") { | ||
presenceData.details = "Main page."; | ||
} else if (document.location.pathname.includes("/posts")) { | ||
presenceData.details = `Читает: ${document.querySelector(".post-header h1").innerHTML}`; | ||
} | ||
}} | ||
if (presenceData.details == null) { | ||
presence.setTrayTitle(); | ||
presence.setActivity(); | ||
} else { | ||
presence.setActivity(presenceData); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "../../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "./dist/" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.