-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(plugin): SoundChanger #1827
Conversation
replacement: [ | ||
// This only runs once, making it a good source for dynamically retrieving all of the sounds the user can change | ||
{ | ||
match: /var (.{1,2})=(\{.+?\});/g, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use \i to match identifiers instead of .{1,2}
match: /var (.{1,2})=(\{.+?\});/g, | |
match: /var (\i)=(\{.+?\});/g, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this match should also be made a bit more specific
}, | ||
// This runs whenever Discord needs to play a sound | ||
{ | ||
match: /(var .{1,2}=.{1,2}\((.{1,2})\));return (.{1,2}\(.{1,2}\))/g, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
settings, | ||
|
||
registerSoundFilenames: (names: Record<string, number>) => { | ||
availableSounds = Vencord.Plugins.plugins.SoundChanger.settings?.store.showDetuneSounds ? Object.keys(names) : Object.keys(names).filter(name => !name.includes("detune")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
availableSounds = Vencord.Plugins.plugins.SoundChanger.settings?.store.showDetuneSounds ? Object.keys(names) : Object.keys(names).filter(name => !name.includes("detune")); | |
availableSounds = settings.store.showDetuneSounds ? Object.keys(names) : Object.keys(names).filter(name => !name.includes("detune")); |
getSound: (name: string) => { | ||
const replacement = soundReplacements.find(r => r.name === name); | ||
|
||
if (replacement?.link) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (replacement?.link) { | |
return replacement?.link; |
return null; | ||
}, | ||
|
||
start: async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use proper methods? they're shorter
start: async () => { | |
async start() { |
#1765 |
Oh! I didn’t even notice yours I’m sorry. Looking at it, it hasn’t really moved in more than two weeks, do you still plan to work on it? @TheKodeToad |
I do, I've just been uh doing things I can give you permissions on the repo if you want to help |
No need for perms I can just PR to your branch. If I find time I’ll see about tackling some of the TODO stuff you have listed there 👍 |
IDK what normal people normally do but i think it's more convenient to directly push instead of having two levels of PR lol |
Haha probably but if it were me I wouldn’t give write access for something to someone I don’t know, totally up to you though I don’t mind either way |
Oops meant to close this earlier, moving this all to #1765 |
This plugin allows users to change sounds, such as the notification sound, call ringtone, and mute/unmute sounds (among others).
Demo video (sound on, of course):
2023-10-20.22-14-18.mp4