Add volume settings to fart plugin (#113)

Co-authored-by: Ven <vendicated@riseup.net>
This commit is contained in:
Animal 2022-10-19 17:28:02 -04:00 committed by GitHub
parent 1f50f78912
commit f81ab5ef93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,8 @@
import { ApplicationCommandOptionType } from "../api/Commands";
import { makeRange } from "../components/PluginSettings/components";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
import { makeLazy } from "../utils/misc";
import definePlugin, { OptionType } from "../utils/types";
import { Settings } from "../Vencord";
export default definePlugin({
name: "Fart2",
@ -22,12 +23,21 @@ export default definePlugin({
execute(args) {
const fart = new Audio("https://raw.githubusercontent.com/ItzOnlyAnimal/AliuPlugins/main/fart.mp3");
fart.volume = 0.3;
fart.volume = Settings.plugins.Fart2.volume;
fart.play();
return {
content: (args[0]) ? `<@${args[0].value}> fart` : "fart"
};
},
}]
}],
options: {
volume: {
description: "how loud you wanna fart (aka volume)",
type: OptionType.SLIDER,
markers: makeRange(0, 1, 0.1),
default: 0.5,
stickToMarkers: false,
}
}
});