mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-25 00:36:23 +00:00
fix outdated badge api code
This commit is contained in:
parent
0ff070443e
commit
014c4b4195
2 changed files with 7 additions and 7 deletions
|
@ -101,7 +101,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
|
|
||||||
async start() {
|
async start() {
|
||||||
Vencord.Api.Badges.addBadge(ContributorBadge);
|
Vencord.Api.Badges.addProfileBadge(ContributorBadge);
|
||||||
await loadBadges();
|
await loadBadges();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,11 @@ function isReporterTestable(p: Plugin, part: ReporterTestable) {
|
||||||
: (p.reporterTestable & part) === part;
|
: (p.reporterTestable & part) === part;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const pluginKeysToBind: Array<keyof PluginDef & `${"on" | "render"}${string}`> = [
|
||||||
|
"onBeforeMessageEdit", "onBeforeMessageSend", "onMessageClick",
|
||||||
|
"renderChatBarButton", "renderMemberListDecorator", "renderMessageAccessory", "renderMessageDecoration", "renderMessagePopoverButton"
|
||||||
|
];
|
||||||
|
|
||||||
const neededApiPlugins = new Set<string>();
|
const neededApiPlugins = new Set<string>();
|
||||||
|
|
||||||
// First round-trip to mark and force enable dependencies
|
// 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.renderMessageDecoration) neededApiPlugins.add("MessageDecorationsAPI");
|
||||||
if (p.renderMessagePopoverButton) neededApiPlugins.add("MessagePopoverAPI");
|
if (p.renderMessagePopoverButton) neededApiPlugins.add("MessagePopoverAPI");
|
||||||
|
|
||||||
const keysToBind: Array<keyof PluginDef & `${"on" | "render"}${string}`> = [
|
for (const key of pluginKeysToBind) {
|
||||||
"onBeforeMessageEdit", "onBeforeMessageSend", "onMessageClick",
|
|
||||||
"renderChatBarButton", "renderMemberListDecorator", "renderMessageAccessory", "renderMessageDecoration", "renderMessagePopoverButton"
|
|
||||||
];
|
|
||||||
|
|
||||||
for (const key of keysToBind) {
|
|
||||||
p[key] &&= p[key].bind(p) as any;
|
p[key] &&= p[key].bind(p) as any;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue