aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNuckyz <61953774+Nuckyz@users.noreply.github.com>2022-10-20 02:48:46 -0300
committerGitHub <noreply@github.com>2022-10-20 07:48:46 +0200
commit350e7b0a6a2f19728a1839dc7db85717af3399d8 (patch)
treef0dc41c98d8b7dd6361f96b695d4480e65f7eb56
parent7eba5b99b0d1012c33fbca1a32dc2c5a3a800eb1 (diff)
downloadVencord-350e7b0a6a2f19728a1839dc7db85717af3399d8.tar.gz
Vencord-350e7b0a6a2f19728a1839dc7db85717af3399d8.tar.bz2
Vencord-350e7b0a6a2f19728a1839dc7db85717af3399d8.zip
feat(moyai): Add option to toggle triggering moyai when the window is not focused (#123)
-rw-r--r--src/plugins/ify.ts2
-rw-r--r--src/plugins/moyai.ts9
-rw-r--r--src/utils/constants.ts4
3 files changed, 13 insertions, 2 deletions
diff --git a/src/plugins/ify.ts b/src/plugins/ify.ts
index 0e6b58d..2bcfeb5 100644
--- a/src/plugins/ify.ts
+++ b/src/plugins/ify.ts
@@ -7,7 +7,7 @@ export default definePlugin({
description: "Disables Spotify auto-pausing, allows activity to continue playing when idling and bypasses premium checks, allowing you to listen along with others.",
authors: [
Devs.Cyn,
- { name: "Nuckyz", id: 235834946571337729n }
+ Devs.Nuckyz
],
patches: [{
diff --git a/src/plugins/moyai.ts b/src/plugins/moyai.ts
index 66cd68c..e3f5db9 100644
--- a/src/plugins/moyai.ts
+++ b/src/plugins/moyai.ts
@@ -33,7 +33,7 @@ const ignoreBots = true;
export default definePlugin({
name: "Moyai",
- authors: [Devs.Megu],
+ authors: [Devs.Megu, Devs.Nuckyz],
description: "🗿🗿🗿🗿🗿🗿🗿🗿",
async onMessage(e: IMessageCreate) {
@@ -78,6 +78,12 @@ export default definePlugin({
markers: makeRange(0, 1, 0.1),
default: 0.5,
stickToMarkers: false,
+ },
+ triggerWhenUnfocused: {
+ description: "Trigger the 🗿 even when the window is unfocused",
+ type: OptionType.BOOLEAN,
+ default: true,
+ restartNeeded: false,
}
}
});
@@ -112,6 +118,7 @@ function getMoyaiCount(message: string) {
}
function boom() {
+ if (!Settings.plugins.Moyai.triggerWhenUnfocused && !document.hasFocus()) return;
const audioElement = document.createElement("audio");
audioElement.src = MOYAI_URL;
audioElement.volume = Settings.plugins.Moyai.volume;
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index 63bc01e..a01786a 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -54,5 +54,9 @@ export const Devs = Object.freeze({
katlyn: {
name: "katlyn",
id: 250322741406859265n
+ },
+ Nuckyz: {
+ name: "Nuckyz",
+ id: 235834946571337729n
}
});