-
-
Save sneksnake/08166875e98741e881e4614a69938870 to your computer and use it in GitHub Desktop.
import definePlugin, { OptionType } from "@utils/types"; | |
export default definePlugin({ | |
name: "Fake Voice Options", | |
description: "fake mute & deafen", | |
authors: [{ | |
name: "SaucyDuck", | |
id: 1004904120056029256n | |
}], | |
patches: [ | |
{ | |
find: "e.setSelfMute(n)", | |
replacement: [{ | |
// prevent client-side mute | |
match: /e\.setSelfMute\(n\),/g, | |
replace: 'e.setSelfMute(Vencord.Settings.plugins["Fake Voice Options"].fakeMute?false:n),' | |
}, | |
{ | |
// prevent client-side deafen | |
match: /e\.setSelfDeaf\(t\.deaf\)/g, | |
replace: 'e.setSelfDeaf(Vencord.Settings.plugins["Fake Voice Options"].fakeDeafen?false:t.deaf)' | |
}] | |
}, | |
], | |
options: { | |
fakeMute: { | |
description: "Make everyone believe you're muted (you can still speak)", | |
type: OptionType.BOOLEAN, | |
default: false, | |
}, | |
fakeDeafen: { | |
description: "Make everyone believe you're deafened (you can still hear)", | |
type: OptionType.BOOLEAN, | |
default: false, | |
}, | |
}, | |
}); |
is it possible to change the settings when discord is running?
Please update, gives errors on pnpm build
Build works, but I'm still figuring out what you mean by using the "fakevoiceoptions" command. Testing this in a private discord server, writing "/fakevoiceoptions" or "!fakevoiceoptions" won't work. Both of the options were activated. But it didn't show myself muted nor deafened.
Of course i can see in your script that you don't write any fakevoiceoptions command in a text channel to make it work. But I'm just figuring out what else makes it work. Is it just server sided without you being able to see the fake deafen icons?
Oh yeah, I ended up getting it to work, but the fake deafen itself doesnβt work. Thereβs one that works which I can send u if u want.
By getting it to work I mean building it.
In the end it will look like that:
create the "fakeVoiceOption" folder and paste in these things
index.tsx
import { disableStyle, enableStyle } from "@api/Styles";
import ErrorBoundary from "@components/ErrorBoundary";
import definePlugin from "@utils/types";
import { findByCodeLazy } from "@webpack";
import { settings } from "./settings";
import style from "./style.css?managed";
const Button = findByCodeLazy("Button.Sizes.NONE,disabled:");
function makeIcon(enabled?: boolean) {
return function () {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="19"
height="19"
viewBox="0 0 512 512"
>
<path fill="currentColor" d="M256 48C141.1 48 48 141.1 48 256v40c0 13.3-10.7 24-24 24s-24-10.7-24-24V256C0 114.6 114.6 0 256 0S512 114.6 512 256V400.1c0 48.6-39.4 88-88.1 88L313.6 488c-8.3 14.3-23.8 24-41.6 24H240c-26.5 0-48-21.5-48-48s21.5-48 48-48h32c17.8 0 33.3 9.7 41.6 24l110.4 .1c22.1 0 40-17.9 40-40V256c0-114.9-93.1-208-208-208zM144 208h16c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32H144c-35.3 0-64-28.7-64-64V272c0-35.3 28.7-64 64-64zm224 0c35.3 0 64 28.7 64 64v48c0 35.3-28.7 64-64 64H352c-17.7 0-32-14.3-32-32V240c0-17.7 14.3-32 32-32h16z"/>
{!enabled &&
<line
x1="495"
y1="10"
x2="10"
y2="464"
stroke="var(--status-danger)"
strokeWidth="40"
/>
}
</svg>
);
};
}
function FakeVoiceOptionToggleButton() {
const FakeMuteEnabled = settings.use(["fakeMute"]).fakeMute;
const FakeDeafenEnabled = settings.use(["fakeDeafen"]).fakeDeafen;
const Enabled = FakeDeafenEnabled && FakeMuteEnabled;
return (
<div className="button-container">
<Button
tooltipText={Enabled ? "Disable Fake/Deafen Mute" : "Enable Fake/Deafen Mute"}
icon={makeIcon(Enabled)}
role="switch"
aria-checked={!Enabled}
onClick={() => {
settings.store.fakeDeafen = !Enabled;
settings.store.fakeMute = !Enabled;
}}
/>
</div>
);
}
export default definePlugin({
name: "Fake Voice Options",
description: "fake mute & deafen",
authors: [{
name: "Wikinger8",
id: 387168065273593878n,
}],
patches: [
{
find: ".Messages.ACCOUNT_SPEAKING_WHILE_MUTED",
replacement: {
match: /this\.renderNameZone\(\).+?children:\[/,
replace: "$&$self.FakeVoiceOptionToggleButton(),"
}
},
{
find: "e.setSelfMute(n);",
replacement: [{
// prevent client-side mute
match: /e\.setSelfMute\(n\);/g,
replace: "e.setSelfMute(Vencord.Settings.plugins[\"Fake Voice Options\"].fakeMute?false:n);"
},
{
// prevent client-side deafen
match: /e\.setSelfDeaf\(t\.deaf\)/g,
replace: "e.setSelfDeaf(Vencord.Settings.plugins[\"Fake Voice Options\"].fakeDeafen?false:t.deaf);"
}]
},
],
FakeVoiceOptionToggleButton: ErrorBoundary.wrap(FakeVoiceOptionToggleButton, { noop: true }),
settings,
start() {
enableStyle(style);
},
stop() {
disableStyle(style);
}
});
settings.ts
import { definePluginSettings } from "@api/Settings";
import { OptionType } from "@utils/types";
export const settings = definePluginSettings({
fakeMute: {
description: "Make everyone believe you're muted (you can still speak)",
type: OptionType.BOOLEAN,
default: false,
},
fakeDeafen: {
description: "Make everyone believe you're deafened (you can still hear) gtxs 2",
type: OptionType.BOOLEAN,
default: false,
},
});
style.css
[class*="withTagAsButton"] {
min-width: 88px;
}
[class*="container-YkUktl"] div:nth-child(2) {
flex-wrap: wrap;
}
[class="container-YkUktl"] {
height: 69px;
}
.button-container {
margin-left: -18px;
}
alright thanks
Sieht nice aus. Werde morgen mal mit Freunden testen. Aber danke
In the end it will look like that:
create the "fakeVoiceOption" folder and paste in these things
index.tsx
import { disableStyle, enableStyle } from "@api/Styles"; import ErrorBoundary from "@components/ErrorBoundary"; import definePlugin from "@utils/types"; import { findByCodeLazy } from "@webpack"; import { settings } from "./settings"; import style from "./style.css?managed"; const Button = findByCodeLazy("Button.Sizes.NONE,disabled:"); function makeIcon(enabled?: boolean) { return function () { return ( <svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" viewBox="0 0 512 512" > <path fill="currentColor" d="M256 48C141.1 48 48 141.1 48 256v40c0 13.3-10.7 24-24 24s-24-10.7-24-24V256C0 114.6 114.6 0 256 0S512 114.6 512 256V400.1c0 48.6-39.4 88-88.1 88L313.6 488c-8.3 14.3-23.8 24-41.6 24H240c-26.5 0-48-21.5-48-48s21.5-48 48-48h32c17.8 0 33.3 9.7 41.6 24l110.4 .1c22.1 0 40-17.9 40-40V256c0-114.9-93.1-208-208-208zM144 208h16c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32H144c-35.3 0-64-28.7-64-64V272c0-35.3 28.7-64 64-64zm224 0c35.3 0 64 28.7 64 64v48c0 35.3-28.7 64-64 64H352c-17.7 0-32-14.3-32-32V240c0-17.7 14.3-32 32-32h16z"/> {!enabled && <line x1="495" y1="10" x2="10" y2="464" stroke="var(--status-danger)" strokeWidth="40" /> } </svg> ); }; } function FakeVoiceOptionToggleButton() { const FakeMuteEnabled = settings.use(["fakeMute"]).fakeMute; const FakeDeafenEnabled = settings.use(["fakeDeafen"]).fakeDeafen; const Enabled = FakeDeafenEnabled && FakeMuteEnabled; return ( <div className="button-container"> <Button tooltipText={Enabled ? "Disable Fake/Deafen Mute" : "Enable Fake/Deafen Mute"} icon={makeIcon(Enabled)} role="switch" aria-checked={!Enabled} onClick={() => { settings.store.fakeDeafen = !Enabled; settings.store.fakeMute = !Enabled; }} /> </div> ); } export default definePlugin({ name: "Fake Voice Options", description: "fake mute & deafen", authors: [{ name: "Wikinger8", id: 387168065273593878n, }], patches: [ { find: ".Messages.ACCOUNT_SPEAKING_WHILE_MUTED", replacement: { match: /this\.renderNameZone\(\).+?children:\[/, replace: "$&$self.FakeVoiceOptionToggleButton()," } }, { find: "e.setSelfMute(n);", replacement: [{ // prevent client-side mute match: /e\.setSelfMute\(n\);/g, replace: "e.setSelfMute(Vencord.Settings.plugins[\"Fake Voice Options\"].fakeMute?false:n);" }, { // prevent client-side deafen match: /e\.setSelfDeaf\(t\.deaf\)/g, replace: "e.setSelfDeaf(Vencord.Settings.plugins[\"Fake Voice Options\"].fakeDeafen?false:t.deaf);" }] }, ], FakeVoiceOptionToggleButton: ErrorBoundary.wrap(FakeVoiceOptionToggleButton, { noop: true }), settings, start() { enableStyle(style); }, stop() { disableStyle(style); } });
settings.ts
import { definePluginSettings } from "@api/Settings"; import { OptionType } from "@utils/types"; export const settings = definePluginSettings({ fakeMute: { description: "Make everyone believe you're muted (you can still speak)", type: OptionType.BOOLEAN, default: false, }, fakeDeafen: { description: "Make everyone believe you're deafened (you can still hear) gtxs 2", type: OptionType.BOOLEAN, default: false, }, });
style.css
[class*="withTagAsButton"] { min-width: 88px; } [class*="container-YkUktl"] div:nth-child(2) { flex-wrap: wrap; } [class="container-YkUktl"] { height: 69px; } .button-container { margin-left: -18px; }
hey, this builds fine, but it doesnt show im deafened in the vc
where put this code ? idk sorry for this questions
Maybe have one tutorial ?
does this still work? I downloaded the plugin but it doesn't show me as deafened to other users
does this still work? I downloaded the plugin but it doesn't show me as deafened to other users
https://www.youtube.com/watch?v=WR7AF1_pmd0
This works
does this still work? I downloaded the plugin but it doesn't show me as deafened to other users
https://www.youtube.com/watch?v=WR7AF1_pmd0
This works
Yeah i was the one who told that guy to make a vid about it - not to flex but yk... π£οΈπ₯π§ββοΈπ₯©π₯©π
does this still work? I downloaded the plugin but it doesn't show me as deafened to other users
https://www.youtube.com/watch?v=WR7AF1_pmd0
This worksYeah i was the one who told that guy to make a vid about it - not to flex but yk... π£οΈπ₯π§ββοΈπ₯©π₯©π
Then tell him that the button is too big
i build this code and didnt run why?
change the first line to
import definePlugin, { OptionType } from "@utils/types";
for other peoples use this guides to get it to work
https://github.com/Vendicated/Vencord/blob/main/docs/1_INSTALLING.md
https://github.com/Vendicated/Vencord/blob/main/docs/2_PLUGINS.md