/* * Vencord, a Discord client mod * Copyright (c) 2024 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import { Devs } from "@utils/constants"; import { getCurrentGuild } from "@utils/discord"; import definePlugin from "@utils/types"; import { findByPropsLazy } from "@webpack"; import { Clipboard, GuildStore, Menu, PermissionStore, TextAndImagesSettingsStores } from "@webpack/common"; const GuildSettingsActions = findByPropsLazy("open", "selectRole", "updateGuild"); function PencilIcon() { return ( ); } function AppearanceIcon() { return ( ); } export default definePlugin({ name: "BetterRoleContext", description: "Adds options to copy role color / edit role when right clicking roles in the user profile", authors: [Devs.Ven], start() { // DeveloperMode needs to be enabled for the context menu to be shown TextAndImagesSettingsStores.DeveloperMode.updateSetting(true); }, contextMenus: { "dev-context"(children, { id }: { id: string; }) { const guild = getCurrentGuild(); if (!guild) return; const role = GuildStore.getRole(guild.id, id); if (!role) return; if (role.colorString) { children.push(