Vencord/src/plugins/ify.ts

22 lines
723 B
TypeScript
Raw Normal View History

2022-10-01 00:27:28 +00:00
import { Devs } from "../utils/constants";
2022-09-02 04:08:23 +00:00
import definePlugin from "../utils/types";
export default definePlugin({
name: "Ify",
description: "Disabes Spotify auto-pausing and premium checks",
2022-10-01 00:27:28 +00:00
authors: [Devs.Cyn],
2022-09-02 04:08:23 +00:00
patches: [
{
find: '.displayName="SpotifyStore"',
2022-09-27 12:34:57 +00:00
replacement: [{
2022-09-02 04:08:23 +00:00
match: /\.isPremium=.;/,
replace: ".isPremium=true;",
2022-09-27 12:34:57 +00:00
}, ...["SPEAKING", "VOICE_STATE_UPDATES", "MEDIA_ENGINE_SET_DESKTOP_SOURCE"].map(event => ({
2022-09-02 04:08:23 +00:00
match: new RegExp(`${event}:function\\(.\\){.+?}(,|}\\))`),
replace: (_, ending) => `${event}:function(){}${ending}`,
})),
2022-09-27 12:34:57 +00:00
],
2022-09-02 04:08:23 +00:00
},
]
});