aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/moyai.ts
diff options
context:
space:
mode:
authormegumin <megumin.bakaretsurie@gmail.com>2022-10-19 20:57:27 +0100
committerGitHub <noreply@github.com>2022-10-19 21:57:27 +0200
commit1f50f78912caeeff1c65182d61b72e6ec95b9899 (patch)
tree8b1bc59c606617d7a8c39951950dc3c3e7bfd074 /src/plugins/moyai.ts
parentefab399309a44f8ea6a783abd13c49abb8cd6e38 (diff)
downloadVencord-1f50f78912caeeff1c65182d61b72e6ec95b9899.tar.gz
Vencord-1f50f78912caeeff1c65182d61b72e6ec95b9899.tar.bz2
Vencord-1f50f78912caeeff1c65182d61b72e6ec95b9899.zip
feat: settings sliders (#120)
Co-authored-by: Ven <vendicated@riseup.net>
Diffstat (limited to 'src/plugins/moyai.ts')
-rw-r--r--src/plugins/moyai.ts20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/plugins/moyai.ts b/src/plugins/moyai.ts
index 581f960..66cd68c 100644
--- a/src/plugins/moyai.ts
+++ b/src/plugins/moyai.ts
@@ -1,8 +1,11 @@
-import definePlugin from "../utils/types";
-import { Devs } from "../utils/constants";
import { Message, ReactionEmoji } from "discord-types/general";
-import { FluxDispatcher, SelectedChannelStore } from "../webpack/common";
+
+import { makeRange } from "../components/PluginSettings/components/SettingSliderComponent";
+import { Devs } from "../utils/constants";
import { sleep } from "../utils/misc";
+import definePlugin, { OptionType } from "../utils/types";
+import { Settings } from "../Vencord";
+import { FluxDispatcher, SelectedChannelStore } from "../webpack/common";
interface IMessageCreate {
type: "MESSAGE_CREATE";
@@ -67,6 +70,16 @@ export default definePlugin({
FluxDispatcher.unsubscribe("MESSAGE_CREATE", this.onMessage);
FluxDispatcher.unsubscribe("MESSAGE_REACTION_ADD", this.onReaction);
},
+
+ options: {
+ volume: {
+ description: "Volume of the 🗿🗿🗿",
+ type: OptionType.SLIDER,
+ markers: makeRange(0, 1, 0.1),
+ default: 0.5,
+ stickToMarkers: false,
+ }
+ }
});
function countOccurrences(sourceString: string, subString: string) {
@@ -101,5 +114,6 @@ function getMoyaiCount(message: string) {
function boom() {
const audioElement = document.createElement("audio");
audioElement.src = MOYAI_URL;
+ audioElement.volume = Settings.plugins.Moyai.volume;
audioElement.play();
}