2023-09-05 16:34:12 +00:00
|
|
|
/*
|
|
|
|
* Vencord, a Discord client mod
|
|
|
|
* Copyright (c) 2023 Vendicated and contributors
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
|
|
|
|
2024-03-07 10:06:24 +00:00
|
|
|
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
|
2024-06-05 21:45:27 +00:00
|
|
|
import { migratePluginSettings } from "@api/Settings";
|
2023-09-05 16:34:12 +00:00
|
|
|
import { Devs } from "@utils/constants";
|
|
|
|
import definePlugin from "@utils/types";
|
|
|
|
import { Menu } from "@webpack/common";
|
|
|
|
import { Guild } from "discord-types/general";
|
|
|
|
|
2024-06-05 21:45:27 +00:00
|
|
|
import { openGuildInfoModal } from "./GuildInfoModal";
|
2023-09-05 16:34:12 +00:00
|
|
|
|
2024-03-07 10:06:24 +00:00
|
|
|
const Patch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild; }) => {
|
2023-09-05 16:34:12 +00:00
|
|
|
const group = findGroupChildrenByChildId("privacy", children);
|
|
|
|
|
|
|
|
group?.push(
|
|
|
|
<Menu.MenuItem
|
2024-06-05 21:45:27 +00:00
|
|
|
id="vc-server-info"
|
2023-10-08 01:49:00 +00:00
|
|
|
label="Server Info"
|
2024-06-05 21:45:27 +00:00
|
|
|
action={() => openGuildInfoModal(guild)}
|
2023-09-05 16:34:12 +00:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2024-06-05 21:45:27 +00:00
|
|
|
migratePluginSettings("ServerInfo", "ServerProfile"); // what was I thinking with this name lmao
|
2023-09-05 16:34:12 +00:00
|
|
|
export default definePlugin({
|
2024-06-05 21:45:27 +00:00
|
|
|
name: "ServerInfo",
|
|
|
|
description: "Allows you to view info about a server",
|
2023-09-05 16:34:12 +00:00
|
|
|
authors: [Devs.Ven, Devs.Nuckyz],
|
2024-06-05 21:45:27 +00:00
|
|
|
tags: ["guild", "info", "ServerProfile"],
|
2024-03-07 10:06:24 +00:00
|
|
|
contextMenus: {
|
|
|
|
"guild-context": Patch,
|
|
|
|
"guild-header-popout": Patch
|
2023-09-05 16:34:12 +00:00
|
|
|
}
|
|
|
|
});
|