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