This repository has been archived by the owner on Nov 30, 2023. It is now read-only.
forked from notsapinho/powercord-together
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (29 loc) · 1.47 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const { getModule, getAllModules } = require("powercord/webpack");
const { inject, uninject } = require("powercord/injector");
const { Plugin } = require("powercord/entities");
const { YOUTUBE_APPLICATION_ID, POKER_NIGHT_APPLICATION_ID, FISHINGTON_APPLICATION_ID, END_GAME_APPLICATION_ID } = getModule(["GENERIC_EVENT_EMBEDDED_APPS"], false);
const useExperiment = getAllModules(["useExperiment"], false).filter(obj => obj.definition.label == "Activities Experiment")[0];
const getGuild = getModule(["getGuild"], false);
const ids = [YOUTUBE_APPLICATION_ID, POKER_NIGHT_APPLICATION_ID, FISHINGTON_APPLICATION_ID, END_GAME_APPLICATION_ID, "832012586023256104"];
module.exports = class PowercordTogether extends Plugin {
async startPlugin() {
inject("powercord-together-region", getGuild, "getGuild", (args, res) => {
if (res) res.region = "us-west";
return res;
});
inject("powercord-together-rocket", useExperiment, "useExperiment", (args, res) => {
if (!args[0].guildId) return res;
if (!res[0]?.enabledApplicationIds?.length) {
res[0].enabledApplicationIds = ids;
res[0].rtcPanelIconsOnly = true;
res[0].showDiscordGameTooltips = true;
res[0].useNewInviteButton = true;
}
return res;
});
}
pluginWillUnload() {
uninject("powercord-together-region");
uninject("powercord-together-rocket");
}
};