From 014c4b41954ad1e71457b59d0d0d8787beaf42d4 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 21 Nov 2024 04:19:01 +0100 Subject: [PATCH] fix outdated badge api code --- src/plugins/_api/badges/index.tsx | 2 +- src/plugins/index.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/_api/badges/index.tsx b/src/plugins/_api/badges/index.tsx index c44d98b90..c2034e209 100644 --- a/src/plugins/_api/badges/index.tsx +++ b/src/plugins/_api/badges/index.tsx @@ -101,7 +101,7 @@ export default definePlugin({ }, async start() { - Vencord.Api.Badges.addBadge(ContributorBadge); + Vencord.Api.Badges.addProfileBadge(ContributorBadge); await loadBadges(); }, diff --git a/src/plugins/index.ts b/src/plugins/index.ts index 37f8be8be..582e35a90 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -89,6 +89,11 @@ function isReporterTestable(p: Plugin, part: ReporterTestable) { : (p.reporterTestable & part) === part; } +const pluginKeysToBind: Array = [ + "onBeforeMessageEdit", "onBeforeMessageSend", "onMessageClick", + "renderChatBarButton", "renderMemberListDecorator", "renderMessageAccessory", "renderMessageDecoration", "renderMessagePopoverButton" +]; + const neededApiPlugins = new Set(); // First round-trip to mark and force enable dependencies @@ -122,12 +127,7 @@ for (const p of pluginsValues) if (isPluginEnabled(p.name)) { if (p.renderMessageDecoration) neededApiPlugins.add("MessageDecorationsAPI"); if (p.renderMessagePopoverButton) neededApiPlugins.add("MessagePopoverAPI"); - const keysToBind: Array = [ - "onBeforeMessageEdit", "onBeforeMessageSend", "onMessageClick", - "renderChatBarButton", "renderMemberListDecorator", "renderMessageAccessory", "renderMessageDecoration", "renderMessagePopoverButton" - ]; - - for (const key of keysToBind) { + for (const key of pluginKeysToBind) { p[key] &&= p[key].bind(p) as any; } }