forceOwnerCrown: fix (#1858)
This commit is contained in:
parent
3917193e8f
commit
06b4dffa62
1 changed files with 6 additions and 7 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue