From 06b4dffa628d39914eaaaf3358d3d0e63d1811eb Mon Sep 17 00:00:00 2001 From: Nico Date: Wed, 25 Oct 2023 17:26:28 +0200 Subject: [PATCH] forceOwnerCrown: fix (#1858) --- src/plugins/forceOwnerCrown/index.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plugins/forceOwnerCrown/index.ts b/src/plugins/forceOwnerCrown/index.ts index eaee6284..15b1f6f5 100644 --- a/src/plugins/forceOwnerCrown/index.ts +++ b/src/plugins/forceOwnerCrown/index.ts @@ -27,18 +27,17 @@ export default definePlugin({ authors: [Devs.D3SOX, Devs.Nickyux], patches: [ { - // This is the logic where it decides whether to render the owner crown or not - find: ".MULTIPLE_AVATAR", + find: "AVATAR_DECORATION_PADDING:", replacement: { - match: /(\i)=(\i)\.isOwner,/, - replace: "$1=$self.isGuildOwner($2)," + match: /,isOwner:(\i),/, + replace: ",_isOwner:$1=$self.isGuildOwner(e)," } } ], - isGuildOwner(props: { user: User, channel: Channel, guildId?: string; }) { - if (!props?.user?.id) return false; + isGuildOwner(props: { user: User, channel: Channel, isOwner: boolean, guildId?: string; }) { + if (!props?.user?.id) return props.isOwner; if (props.channel?.type === 3 /* GROUP_DM */) - return false; + return props.isOwner; // guild id is in props twice, fallback if the first is undefined const guildId = props.guildId ?? props.channel?.guild_id;