Skip to content
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

Closed
wants to merge 8 commits into from
Closed

feat(plugin): SoundChanger #1827

wants to merge 8 commits into from

Conversation

SpikeHD
Copy link

@SpikeHD SpikeHD commented Oct 21, 2023

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

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,
Copy link
Owner

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}

Suggested change
match: /var (.{1,2})=(\{.+?\});/g,
match: /var (\i)=(\{.+?\});/g,

Copy link
Owner

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,
Copy link
Owner

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"));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (replacement?.link) {
return replacement?.link;

return null;
},

start: async () => {
Copy link
Owner

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

Suggested change
start: async () => {
async start() {

@TheKodeToad
Copy link
Contributor

#1765
why another effort? 😭

@SpikeHD
Copy link
Author

SpikeHD commented Oct 21, 2023

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

@TheKodeToad
Copy link
Contributor

I do, I've just been uh

doing things

I can give you permissions on the repo if you want to help

@SpikeHD
Copy link
Author

SpikeHD commented Oct 21, 2023

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 👍

@TheKodeToad
Copy link
Contributor

IDK what normal people normally do but i think it's more convenient to directly push instead of having two levels of PR lol

@SpikeHD
Copy link
Author

SpikeHD commented Oct 21, 2023

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

@SpikeHD
Copy link
Author

SpikeHD commented Oct 22, 2023

Oops meant to close this earlier, moving this all to #1765

@SpikeHD SpikeHD closed this Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants