diff --git a/index.tsx b/index.tsx index 2ee3f19..1a27ad6 100644 --- a/index.tsx +++ b/index.tsx @@ -6,23 +6,11 @@ import "./style.css"; -import { classNameFactory } from "@api/Styles"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; -import { findComponentByCodeLazy } from "@webpack"; import { ChannelStore, DateUtils, GuildStore, IconUtils, NavigationRouter, Popout, SnowflakeUtils, Text, UserStore, useStateFromStores } from "@webpack/common"; -import { Guild } from "discord-types/general"; -const ServerProfileComponent = findComponentByCodeLazy("{guildProfile:v,fetchGuildProfile:O,fetchStatus:I}"); -const cl = classNameFactory("vc-serverprofileforward-"); - -const ArrowSvg = () => ; - -const checkForIconExistence = (guild: Guild) => { - if (!guild) return false; - if (!guild.icon) return false; - return true; -}; +import { ArrowSvg, checkForIconExistence, cl, ServerProfileComponent } from "./utils"; export default definePlugin({ name: "MoreForwardMeta", @@ -64,11 +52,10 @@ export default definePlugin({ - Voice channel - Announcement channel - Stage channel - - Directory channel - Forum channel - Media channel */ - if ([0, 2, 5, 13, 14, 15, 16].includes(channel.type)) return `#${channel.name}`; + if ([0, 2, 5, 13, 15, 16].includes(channel.type)) return `#${channel.name}`; // DMs if (channel.type === 1) return `@${(() => { const user = UserStore.getUser(channel.recipients[0]); diff --git a/utils.tsx b/utils.tsx new file mode 100644 index 0000000..b9a7922 --- /dev/null +++ b/utils.tsx @@ -0,0 +1,20 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2025 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { classNameFactory } from "@api/Styles"; +import { findComponentByCodeLazy } from "@webpack"; +import { Guild } from "discord-types/general"; + +export const ServerProfileComponent = findComponentByCodeLazy("{guildProfile:v,fetchGuildProfile:O,fetchStatus:I}"); +export const cl = classNameFactory("vc-serverprofileforward-"); + +export const ArrowSvg = () => ; + +export const checkForIconExistence = (guild: Guild) => { + if (!guild) return false; + if (!guild.icon) return false; + return true; +};