import { NavContextMenuPatchCallback } from "@api/ContextMenu"; import { ImageIcon, SafetyIcon } from "@components/Icons"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; import { showCustomDurationModal, showPrefefinedDurationModal } from "./Modals"; import { GuildMemberStore, i18n, IconUtils, Menu, SelectedGuildStore } from "@webpack/common"; import { UserContextProps } from "plugins/biggerStreamPreview"; /**** BEGIN CONFIG ****/ const GUILD_ID = "1274790619146879108"; // SERVER ID /**** END CONFIG ****/ const UserContext: NavContextMenuPatchCallback = (children, { user }: UserContextProps) => { if (!user) return; children.splice(-3, 0, ( <> {SelectedGuildStore.getGuildId() === GUILD_ID && <> { showPrefefinedDurationModal("1h", user.id); }} icon={SafetyIcon} /> { showPrefefinedDurationModal("2h", user.id); }} icon={SafetyIcon} /> { showCustomDurationModal(user.id); }} icon={SafetyIcon} /> } ) ); }; export default definePlugin({ name: "PunishmentCommands", description: "Allows you to send a command in chat to punish someone, right from the context menu", authors: [Devs.nin0dev], contextMenus: { "user-context": UserContext } });