/*
* Vencord, a Discord client mod
* Copyright (c) 2024 nin0dev
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import "./style.css";
import { ApplicationCommandInputType, ApplicationCommandOptionType, sendBotMessage } from "@api/Commands";
import { getUserSettingLazy } from "@api/UserSettings";
import { InfoIcon } from "@components/Icons";
import { Devs } from "@utils/constants";
import { getCurrentChannel, getCurrentGuild } from "@utils/discord";
import definePlugin from "@utils/types";
import { Forms, GuildMemberStore, GuildStore, Menu, Parser } from "@webpack/common";
import { GuildMember } from "discord-types/general";
import { showInRoleModal } from "./RoleMembersModal";
const DeveloperMode = getUserSettingLazy("appearance", "developerMode")!;
function getMembersInRole(roleId: string, guildId: string) {
const members = GuildMemberStore.getMembers(guildId);
const membersInRole: GuildMember[] = [];
members.forEach(member => {
if (member.roles.includes(roleId)) {
membersInRole.push(member);
}
});
return membersInRole;
}
export default definePlugin({
name: "InRole",
description: "Know who is in a role (read plugin info!)",
authors: [Devs.nin0dev],
dependencies: ["UserSettingsAPI"],
start() {
// DeveloperMode needs to be enabled for the context menu to be shown
DeveloperMode.updateSetting(true);
},
settingsAboutComponent: () => {
return (
<>