/** * ╔══════════════════════════════════════════════════════════════════╗ * ║ ║ * ║ ░█▀▀░█▀█░█▀▄░█▀▀░█░█ ░█▀▄░█▀▀░█░█░█▀▀ ║ * ║ ░█░░░█░█░█░█░█▀▀░▄▀▄ ░█░█░█▀▀░▀▄▀░▀▀█ ║ * ║ ░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀ ░▀▀░░▀▀▀░░▀░░▀▀▀ ║ * ║ ║ * ║ © 2026 CodeX Devs — All Rights Reserved ║ * ║ ║ * ║ discord ── https://discord.gg/codexdev ║ * ║ youtube ── https://youtube.com/@CodeXDevs ║ * ║ github ── https://github.com/RayExo ║ * ║ ║ * ╚══════════════════════════════════════════════════════════════════╝ */ "use client"; import React, { useState } from "react"; import { Shield, Save, RefreshCcw, Star, Crown, Heart, Ghost, Settings } from "lucide-react"; import { toast } from "sonner"; import { api } from "@/lib/api"; import { Button } from "@/components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { cn } from "@/lib/utils"; interface CustomRolesFormProps { initialConfig: any; roles: any[]; guildId: string; } const ROLE_INPUTS = [ { label: "Staff Role", key: "staff", icon: Shield, color: "text-blue-500", bg: "bg-blue-500/20" }, { label: "Girl Role", key: "girl", icon: Heart, color: "text-pink-500", bg: "bg-pink-500/20" }, { label: "VIP Role", key: "vip", icon: Crown, color: "text-yellow-500", bg: "bg-yellow-500/20" }, { label: "Guest Role", key: "guest", icon: Ghost, color: "text-gray-400", bg: "bg-gray-400/20" }, { label: "Friend Role", key: "frnd", icon: Star, color: "text-green-500", bg: "bg-green-500/20" }, ]; export function CustomRolesForm({ initialConfig, roles, guildId }: CustomRolesFormProps) { const [config, setConfig] = useState(initialConfig); const [saving, setSaving] = useState(false); const filteredRoles = roles.filter(r => r.name !== "@everyone"); const handleSave = async () => { setSaving(true); const promise = api.updateCustomRoles(guildId, config); toast.promise(promise, { loading: 'Saving Custom Roles configuration...', success: 'Custom Roles settings saved successfully!', error: 'Failed to update Custom Roles config', }); try { await promise; } catch (err: any) { console.error(err); } finally { setSaving(false); } }; return (

Required Permission Role

Users need this role to assign the custom roles below.

{ROLE_INPUTS.map((input) => (

{input.label}

Role assigned via .{input.key} command

))}

Command Usage

Allows your trusted server managers to grant specific preset roles with simple prefix commands.

  • .staff @user - Assigns/Removes Staff role
  • .girl @user - Assigns/Removes Girl role
  • .vip @user - Assigns/Removes VIP role
  • • Ensure Zyrox is placed higher than these roles in server settings!
); }