Skip to content
This repository has been archived by the owner on Feb 18, 2023. It is now read-only.

Commit

Permalink
Fix features show premid not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Faelayis committed May 28, 2022
1 parent 679a847 commit 327b92b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"type": "added",
"items": ["Update channel pre release", "Features Optional show premid"]
},
{
"title": "Fixed",
"type": "fixed",
"items": ["Features show premid not working"]
},
{
"title": "Improved",
"type": "improved",
Expand Down
20 changes: 15 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const changelog = {
type: "added",
items: ["Update channel pre release", "Features Optional show premid"],
},
{
title: "Fixed",
type: "fixed",
items: ["Features show premid not working"],
},
{
title: "Improved",
type: "improved",
Expand All @@ -54,6 +59,7 @@ export default class Plugin {
if (!this.settings.customstatus_hide) {
this.settings.customstatus_hide = ["invisible"];
}
!this.settings.show_premid ? (this.settings.show_premid = true) : undefined;
this.updateSettings();
}
async connected() {
Expand Down Expand Up @@ -172,12 +178,16 @@ export default class Plugin {
if (this.settings.customstatus_hide?.includes(ZLibrary.DiscordModules.UserSettingsStore.status)) return this.client.setActivity(null);
if (this.settings.automatically?.hide?.spotify && ZLibrary.DiscordModules.UserActivityStore.getActivity()?.name === "Spotify" ? true : false)
return this.client.setActivity(null);
if ((this.settings.show_premid ?? true) && BdApi) {
if (
this.settings.show_premid &&
BdApi &&
BdApi.findModuleByProps("getActivities")
.getActivities()
.find((data) => data === data.assets.large_text.includes("PreMiD"));
return;
}
.find((data) => data.assets?.large_text.match(/(PreMiD)/))
? true
: false
)
return this.client.setActivity(null);
const Presence = {
details: `CPU ${(await currentLoad().then((data) => data.currentLoad.toFixed(0))) || "0"}%`,
state: `RAM ${this.formatRAM(freemem(), totalmem())}`,
Expand Down Expand Up @@ -468,7 +478,7 @@ export default class Plugin {
})
.appendTo(panel)
.append(
new ZLibrary.Settings.Switch("Show Premid", undefined, this.settings.show_premid || true, (value) => {
new ZLibrary.Settings.Switch("Show Premid", undefined, this.settings.show_premid, (value) => {
this.settings.show_premid = value;
}),
new ZLibrary.Settings.RadioGroup(
Expand Down

0 comments on commit 327b92b

Please sign in to comment.