Plugin

ForceOwnerCrown

Force the owner crown next to usernames even if the server is large.

Roles Appearance Servers
index.ts
Download

Source

src/plugins/forceOwnerCrown/index.ts
1/*
2 * FiveCord — a Discord client mod
3 * Copyright (c) 2025 FiveCord
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
7import { Devs } from "@utils/constants";
8import definePlugin from "@utils/types";
9import { Channel, User } from "@vencord/discord-types";
10import { GuildStore } from "@webpack/common";
11
12export default definePlugin({
13 name: "ForceOwnerCrown",
14 description: "Force the owner crown next to usernames even if the server is large.",
15 authors: [Devs.D3SOX, Devs.Nickyux],
16 tags: ["Roles", "Appearance", "Servers"],
17 patches: [
18 {
19 find: "#{intl::GUILD_OWNER}),children:",
20 replacement: {
21 match: /(?<=decorators:.{0,200}?isOwner:)\i/,
22 replace: "$self.isGuildOwner(arguments[0])"
23 }
24 }
25 ],
26 isGuildOwner(props: { user: User, channel: Channel, isOwner: boolean, guildId?: string; }) {
27 if (!props?.user?.id) return props.isOwner;
28 if (props.channel?.type === 3 /* GROUP_DM */)
29 return props.isOwner;
30
31 // guild id is in props twice, fallback if the first is undefined
32 const guildId = props.guildId ?? props.channel?.guild_id;
33 const userId = props.user.id;
34
35 return GuildStore.getGuild(guildId)?.ownerId === userId;
36 },
37});
38