1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-09 09:26:22 +00:00

need to bind handlers

This commit is contained in:
Vendicated 2024-11-21 04:16:46 +01:00
parent 5da1c26163
commit 0ff070443e
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -27,7 +27,7 @@ import { addMessagePopoverButton, removeMessagePopoverButton } from "@api/Messag
import { Settings } from "@api/Settings";
import { Logger } from "@utils/Logger";
import { canonicalizeFind } from "@utils/patches";
import { Patch, Plugin, ReporterTestable, StartAt } from "@utils/types";
import { Patch, Plugin, PluginDef, ReporterTestable, StartAt } from "@utils/types";
import { FluxDispatcher } from "@webpack/common";
import { FluxEvents } from "@webpack/types";
@ -121,6 +121,15 @@ for (const p of pluginsValues) if (isPluginEnabled(p.name)) {
if (p.renderMessageAccessory) neededApiPlugins.add("MessageAccessoriesAPI");
if (p.renderMessageDecoration) neededApiPlugins.add("MessageDecorationsAPI");
if (p.renderMessagePopoverButton) neededApiPlugins.add("MessagePopoverAPI");
const keysToBind: Array<keyof PluginDef & `${"on" | "render"}${string}`> = [
"onBeforeMessageEdit", "onBeforeMessageSend", "onMessageClick",
"renderChatBarButton", "renderMemberListDecorator", "renderMessageAccessory", "renderMessageDecoration", "renderMessagePopoverButton"
];
for (const key of keysToBind) {
p[key] &&= p[key].bind(p) as any;
}
}
for (const p of neededApiPlugins) {