mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-13 16:43:04 -04:00
feat: settings sliders (#120)
Co-authored-by: Ven <vendicated@riseup.net>
This commit is contained in:
parent
efab399309
commit
1f50f78912
10 changed files with 123 additions and 40 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue