import React, { useState, useEffect, useRef } from 'react'; import { Disc, Play, Pause, SkipForward, SkipBack, Volume2, Volume1, VolumeX, Plus, Trash2, Wand2, Terminal, HelpCircle, AlertTriangle, Layers, Cpu, Tv, ListMusic, CheckCircle, ExternalLink, ChevronRight, ShieldCheck, Zap, Music, Maximize2, LogOut, Send, Sliders, AudioLines, Sparkles, Info, X, MessageSquare } from 'lucide-react'; import { SongTrack, BotStats, DiscordCommand, MockDiscordMessage, INITIAL_QUEUE, BOT_COMMANDS } from './types'; // Browser Sound Synthesizer Engine class WebMusicSynth { private ctx: AudioContext | null = null; private activeOscillators: OscillatorNode[] = []; private mainGainNode: GainNode | null = null; init() { if (!this.ctx) { const AudioContextClass = window.AudioContext || (window as any).webkitAudioContext; if (AudioContextClass) { this.ctx = new AudioContextClass(); } } } // Plays a synth-based Airhorn blow playAirhorn() { this.init(); if (!this.ctx) return; const now = this.ctx.currentTime; const gain = this.ctx.createGain(); gain.connect(this.ctx.destination); gain.gain.setValueAtTime(0, now); gain.gain.linearRampToValueAtTime(0.3, now + 0.05); gain.gain.linearRampToValueAtTime(0.2, now + 0.2); gain.gain.exponentialRampToValueAtTime(0.001, now + 0.8); // Create classic double oscillator detuned discord airhorn const frequencies = [220, 222, 330, 440]; frequencies.forEach(f => { const osc = this.ctx!.createOscillator(); osc.type = 'sawtooth'; osc.frequency.setValueAtTime(f, now); osc.frequency.linearRampToValueAtTime(f - 5, now + 0.6); const filter = this.ctx!.createBiquadFilter(); filter.type = 'lowpass'; filter.frequency.setValueAtTime(1000, now); osc.connect(filter); filter.connect(gain); osc.start(now); osc.stop(now + 0.8); }); } // Plays laser synth noise playLaser() { this.init(); if (!this.ctx) return; const now = this.ctx.currentTime; const osc = this.ctx.createOscillator(); const gain = this.ctx.createGain(); osc.type = 'triangle'; osc.frequency.setValueAtTime(1200, now); osc.frequency.exponentialRampToValueAtTime(80, now + 0.45); gain.gain.setValueAtTime(0.25, now); gain.gain.exponentialRampToValueAtTime(0.001, now + 0.45); osc.connect(gain); gain.connect(this.ctx.destination); osc.start(now); osc.stop(now + 0.5); } // Plays beautiful deep major chord major sweep pad playSynthPad() { this.init(); if (!this.ctx) return; const now = this.ctx.currentTime; const chords = [196.00, 246.94, 293.66, 392.00]; // G3, B3, D4, G4 major chord const masterGain = this.ctx.createGain(); masterGain.gain.setValueAtTime(0, now); masterGain.gain.linearRampToValueAtTime(0.3, now + 0.2); masterGain.gain.exponentialRampToValueAtTime(0.001, now + 2.5); masterGain.connect(this.ctx.destination); chords.forEach((freq, idx) => { const osc = this.ctx!.createOscillator(); const oscGain = this.ctx!.createGain(); osc.type = 'sine'; osc.frequency.setValueAtTime(freq + (idx * 0.4), now); oscGain.gain.setValueAtTime(0.08, now); osc.connect(oscGain); oscGain.connect(masterGain); osc.start(now); osc.stop(now + 2.6); }); } // Toggle sustained rain background noise toggleRain(enable: boolean) { this.init(); if (!this.ctx) return; if (!enable) { if (this.mainGainNode) { try { this.mainGainNode.gain.setValueAtTime(this.mainGainNode.gain.value, this.ctx.currentTime); this.mainGainNode.gain.exponentialRampToValueAtTime(0.001, this.ctx.currentTime + 0.8); } catch {} } return; } const now = this.ctx.currentTime; this.mainGainNode = this.ctx.createGain(); this.mainGainNode.gain.setValueAtTime(0, now); this.mainGainNode.gain.linearRampToValueAtTime(0.25, now + 1.0); this.mainGainNode.connect(this.ctx.destination); const bufferSize = 2 * this.ctx.sampleRate; const noiseBuffer = this.ctx.createBuffer(1, bufferSize, this.ctx.sampleRate); const output = noiseBuffer.getChannelData(0); let lastOut = 0.0; for (let i = 0; i < bufferSize; i++) { const white = Math.random() * 2 - 1; output[i] = (lastOut + (0.02 * white)) / 1.02; lastOut = output[i]; output[i] *= 3.5; } const noiseSource = this.ctx.createBufferSource(); noiseSource.buffer = noiseBuffer; noiseSource.loop = true; const lowpass = this.ctx.createBiquadFilter(); lowpass.type = 'lowpass'; lowpass.frequency.setValueAtTime(700, now); noiseSource.connect(lowpass); lowpass.connect(this.mainGainNode); noiseSource.start(now); } } export default function App() { const [activeTab, setActiveTab] = useState<'home' | 'dashboard' | 'console'>('home'); const [joinedChannel, setJoinedChannel] = useState(false); const [guildName, setGuildName] = useState('Mi Servidor Principal'); // Music Player state variables const [isPlaying, setIsPlaying] = useState(true); const [songQueue, setSongQueue] = useState(INITIAL_QUEUE); const [currentTrackIndex, setCurrentTrackIndex] = useState(0); const [playProgress, setPlayProgress] = useState(15); // offset ratio (seconds) const [volume, setVolume] = useState(90); const [bassboostMode, setBassboostMode] = useState<'Off' | 'Bass+ Low'| 'Glizh Heavy'>('Off'); const [activeFilter, setActiveFilter] = useState<'None' | 'Nightcore' | 'Vaporwave' | 'Lo-Fi Chill'>('None'); // Interactive Custom Adding state const [manualTitle, setManualTitle] = useState(''); const [manualArtist, setManualArtist] = useState(''); const [geminiSearchQuery, setGeminiSearchQuery] = useState(''); const [isAiSuggesting, setIsAiSuggesting] = useState(false); // Sound effects state const synthRef = useRef(null); const [isRainEnabled, setIsRainEnabled] = useState(false); // Stats Counters const [botStats, setBotStats] = useState({ guilds: 18249, users: 489210, voiceChannels: 3412, ping: 18, uptime: '28d 4h 12m' }); // Discord Chat Terminal Simulator states const [discordChat, setDiscordChat] = useState([ { id: 'msg-1', author: { username: 'cristophergamer', avatar: '🎮', isBot: false, colorClass: 'text-amber-400 font-bold' }, content: 'Buenas gente, ¿qué bot de música vamos a usar hoy? Hay que armar una sesión chill.', timestamp: 'Hoy a las 02:01 AM' }, { id: 'msg-2', author: { username: 'mandy_xx', avatar: '🐱', isBot: false, colorClass: 'text-rose-450 font-bold' }, content: '¡Usemos Glizh! Suena muchísimo más limpio que los otros bots y tiene unos graves brutales.', timestamp: 'Hoy a las 02:02 AM' }, { id: 'msg-3', author: { username: 'Glizh', avatar: '👑', isBot: true, colorClass: 'text-yellow-400 font-bold' }, timestamp: 'Hoy a las 02:02 AM', embed: { title: '🎶 Glizh Sound System v4.8 Activo', description: '¡Gracias por llamarme! Estoy escuchando en el canal de voz **🔊 General Ambient**. Puedes invitar a tus amigos o usar `/play` directamente aquí.', color: 'border-amber-500', fields: [ { name: 'DSP Core', value: '🟢 Ultra Stereo Link (320kbps)', inline: true }, { name: 'Filtro Activo', value: '✨ Glizh ClearAudio v4', inline: true }, ], footer: 'Listo | Comandos de barra activos' } } ]); const [consoleInput, setConsoleInput] = useState(''); const [isConsoleGenerating, setIsConsoleGenerating] = useState(false); // Discord Authorization Gateway Dialog const [showInviteModal, setShowInviteModal] = useState(false); const [inviteServerName, setInviteServerName] = useState('Mi Servidor Dorado'); const [inviteCompleted, setInviteCompleted] = useState(false); // Floating Assistant state variables const [isAssistantOpen, setIsAssistantOpen] = useState(false); const [assistantHistory, setAssistantHistory] = useState<{ sender: 'user' | 'bot'; text: string }[]>([ { sender: 'bot', text: '¡Hola! Soy Glizh AI, el asistente virtual integrado. Pregúntame lo que quieras sobre comandos de música, filtros de audio DSP, o cómo solucionar problemas con Lavalink. ✨' } ]); const [assistantInput, setAssistantInput] = useState(''); const [isAssistantLoading, setIsAssistantLoading] = useState(false); const assistantEndRef = useRef(null); const activeTrack: SongTrack | undefined = songQueue[currentTrackIndex]; // Auto scroll assistant chat to bottom useEffect(() => { if (isAssistantOpen) { assistantEndRef.current?.scrollIntoView({ behavior: 'smooth' }); } }, [assistantHistory, isAssistantOpen]); // Tick playback timer every second useEffect(() => { let interval: any = null; if (isPlaying && activeTrack) { interval = setInterval(() => { setPlayProgress(prev => { const rawDuration = activeTrack.duration; const [m, s] = rawDuration.split(':').map(Number); const totalSecs = (m * 60) + s; if (prev >= totalSecs) { handleSkipForward(); return 0; } return prev + 1; }); }, 1000); } return () => clearInterval(interval); }, [isPlaying, currentTrackIndex, songQueue]); // Audio synths lazy initializer const getSynth = () => { if (!synthRef.current) { synthRef.current = new WebMusicSynth(); } return synthRef.current; }; // Convert seconds back to readable time string MM:SS const formatTime = (seconds: number) => { const mins = Math.floor(seconds / 60); const secs = seconds % 60; return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`; }; // Skip tracks functions const handleSkipForward = () => { if (songQueue.length === 0) return; setPlayProgress(0); setCurrentTrackIndex(prev => (prev + 1) % songQueue.length); }; const handleSkipBack = () => { setPlayProgress(0); setCurrentTrackIndex(prev => (prev - 1 + songQueue.length) % songQueue.length); }; const handleTogglePlay = () => { setIsPlaying(prev => !prev); getSynth().playSynthPad(); }; const handleRemoveTrack = (id: string, idx: number) => { if (songQueue.length <= 1) { alert("¡Glizh debe mantener al menos 1 canción en la cola para no detener la música!"); return; } setSongQueue(prev => prev.filter(t => t.id !== id)); if (idx === currentTrackIndex) { setCurrentTrackIndex(0); setPlayProgress(0); } else if (idx < currentTrackIndex) { setCurrentTrackIndex(prev => Math.max(0, prev - 1)); } }; // Adds raw manual tracks const handleAddManualTrack = () => { if (!manualTitle.trim()) return; const newT: SongTrack = { id: `manual-${Date.now()}`, title: manualTitle, artist: manualArtist.trim() || 'Artista Desconocido', duration: '03:15', genre: 'Cola Manual', requester: 'Tú' }; setSongQueue(prev => [...prev, newT]); setManualTitle(''); setManualArtist(''); }; // Suggest custom playlist using Gemini const handleGeminiPlaylistSuggest = async () => { if (!geminiSearchQuery.trim()) { alert("Por favor escribe un ambiente o género. E.g. 'reggaeton viejo para bailar' o 'bachata romantica'"); return; } setIsAiSuggesting(true); try { const response = await fetch('/api/music/suggest', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ query: geminiSearchQuery }) }); const data = await response.json(); if (data.error) throw new Error(data.error); if (data.tracks && Array.isArray(data.tracks)) { const parsedTracks: SongTrack[] = data.tracks.map((t: any, index: number) => ({ id: `ai-suggest-${Date.now()}-${index}`, title: t.title || 'Melodía Dinámica', artist: t.artist || 'Glizh AI Studio', duration: t.duration || '03:00', genre: t.genre || 'Género sugerido', requester: 'Asistente Glizh' })); setSongQueue(prev => [...prev, ...parsedTracks]); const discordEvent: MockDiscordMessage = { id: `disc-event-${Date.now()}`, author: { username: 'Glizh', avatar: '👑', isBot: true, colorClass: 'text-yellow-400 font-bold' }, timestamp: 'Hoy a las ' + new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}), embed: { title: `💿 Cola generada por IA cargada: "${geminiSearchQuery}"`, description: `¡El motor inteligente analizó el prompt y añadió **${parsedTracks.length} canciones** a la cola de reproducción!`, color: 'border-yellow-500', fields: parsedTracks.map((t, i) => ({ name: `${i+1}. ${t.title}`, value: `de *${t.artist}* • Duración: ${t.duration}` })), footer: 'Recomendador Inteligente Glizh | Gemini API' } }; setDiscordChat(prev => [...prev, discordEvent]); setGeminiSearchQuery(''); alert(`¡Glizh cargó exitosamente ${parsedTracks.length} canciones en la cola! Compruébalo en la consola o el reproductor.`); } } catch (e: any) { console.error(e); alert(`No se pudo generar la recomendación: ${e.message || 'Verifica la clave de Gemini en el servidor.'}`); } finally { setIsAiSuggesting(false); } }; // Pre-configured "Music Themes" for rapid testing const loadPresetTheme = (theme: 'retro' | 'workout' | 'jazz') => { let preset: SongTrack[] = []; if (theme === 'retro') { preset = [ { id: `retro-1-${Date.now()}`, title: 'Provenza', artist: 'KAROL G', duration: '03:27', genre: 'Reggaeton', requester: 'reggaeton_lover' }, { id: `retro-2-${Date.now()}`, title: 'La Bachata', artist: 'Manuel Turizo', duration: '02:42', genre: 'Bachata', requester: 'reggaeton_lover' }, { id: `retro-3-${Date.now()}`, title: 'Un Preview', artist: 'Bad Bunny', duration: '02:44', genre: 'Reggaeton/Trap', requester: 'you' } ]; } else if (theme === 'workout') { preset = [ { id: `work-1-${Date.now()}`, title: 'Trap De La Calle', artist: 'Myke Towers', duration: '03:15', genre: 'Trap Latino', requester: 'shreed_33' }, { id: `work-2-${Date.now()}`, title: 'La Jeepeta', artist: 'Anuel AA', duration: '03:45', genre: 'Trap Latino', requester: 'shreed_33' } ]; } else { preset = [ { id: `jazz-1-${Date.now()}`, title: 'Amargura', artist: 'KAROL G', duration: '02:50', genre: 'Reggaeton', requester: 'zesty_fans' }, { id: `jazz-2-${Date.now()}`, title: 'Ella Baila Sola', artist: 'Eslabon Armado & Peso Pluma', duration: '02:44', genre: 'Regional Mexicano', requester: 'you' } ]; } setSongQueue(prev => [...prev, ...preset]); getSynth().playSynthPad(); }; // Soundboard instant click SFX triggers const triggerSFX = (type: 'airhorn' | 'laser' | 'pad') => { const synth = getSynth(); if (type === 'airhorn') synth.playAirhorn(); if (type === 'laser') synth.playLaser(); if (type === 'pad') synth.playSynthPad(); }; const handleToggleRainAmbient = () => { const nextState = !isRainEnabled; setIsRainEnabled(nextState); getSynth().toggleRain(nextState); }; // Submit Slash command in simulated terminal chat const handleSendConsole = async (overrideMsg?: string) => { const actualInput = overrideMsg || consoleInput; if (!actualInput.trim()) return; const userMessage: MockDiscordMessage = { id: `discord-usr-${Date.now()}`, author: { username: 'tú', avatar: '⚡', isBot: false, colorClass: 'text-amber-400 font-bold' }, content: actualInput, timestamp: 'Hoy a las ' + new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}) }; setDiscordChat(prev => [...prev, userMessage]); if (!overrideMsg) setConsoleInput(''); setIsConsoleGenerating(true); const cmdClean = actualInput.toLowerCase().trim(); if (cmdClean.startsWith('/play ')) { const targetQuery = actualInput.substring(6); setTimeout(() => { const newTrack: SongTrack = { id: `cmd-added-${Date.now()}`, title: targetQuery.charAt(0).toUpperCase() + targetQuery.slice(1), artist: 'Artista Encontrado', duration: '03:10', genre: 'Vía Terminal', requester: 'tú' }; setSongQueue(prev => [...prev, newTrack]); setDiscordChat(prev => [...prev, { id: `discord-bot-${Date.now()}`, author: { username: 'Glizh', avatar: '👑', isBot: true, colorClass: 'text-yellow-400 font-bold' }, timestamp: 'Hoy a las ' + new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}), embed: { title: `🔊 Añadido a la cola`, description: `Se añadió **${newTrack.title}** de *${newTrack.artist}* en la posición **#${songQueue.length + 1}**`, color: 'border-yellow-500', fields: [ { name: 'Tamaño de cola', value: `${songQueue.length + 1} canciones`, inline: true }, { name: 'Reproducción aproximada', value: `En aprox ${(songQueue.length) * 3} mins`, inline: true } ], footer: 'Glizh Music Engine | Activo' } }]); setIsConsoleGenerating(false); }, 500); } else if (cmdClean === '/skip') { setTimeout(() => { handleSkipForward(); setDiscordChat(prev => [...prev, { id: `discord-bot-${Date.now()}`, author: { username: 'Glizh', avatar: '👑', isBot: true, colorClass: 'text-yellow-400 font-bold' }, timestamp: 'Hoy a las ' + new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}), embed: { title: '⏭️ Canción Saltada', description: `Ahora suena: **${songQueue[(currentTrackIndex + 1) % songQueue.length]?.title || 'Ninguna'}**`, color: 'border-amber-500' } }]); setIsConsoleGenerating(false); }, 400); } else if (cmdClean === '/queue') { setTimeout(() => { setDiscordChat(prev => [...prev, { id: `discord-bot-${Date.now()}`, author: { username: 'Glizh', avatar: '👑', isBot: true, colorClass: 'text-yellow-400 font-bold' }, timestamp: 'Hoy a las ' + new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}), embed: { title: '📜 Lista de Canciones en Espera', description: songQueue.map((t, i) => `${i === currentTrackIndex ? '➔ 🔊' : `• [${i+1}]`} **${t.title}** - *${t.artist}* (${t.duration})`).join('\n'), color: 'border-yellow-500', footer: 'Glizh Bot | Usa /skip para saltar' } }]); setIsConsoleGenerating(false); }, 400); } else if (cmdClean === '/lyrics') { setTimeout(() => { setDiscordChat(prev => [...prev, { id: `discord-bot-${Date.now()}`, author: { username: 'Glizh', avatar: '👑', isBot: true, colorClass: 'text-yellow-400 font-bold' }, timestamp: 'Hoy a las ' + new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}), embed: { title: `🎵 Letra de: "${activeTrack?.title || 'Nada Sonando'}"`, description: `*(Pre-loaded lyrics excerpt)*\n\n[00:12] Baby, te vi en Provenza...\n[00:25] Hace rato que no sé de ti...\n[00:44] Aunque ande con otra, no te olvido...\n\n(Sincronización de letra en vivo activa)`, color: 'border-yellow-500' } }]); setIsConsoleGenerating(false); }, 550); } else if (cmdClean.startsWith('/volume ')) { const volVal = parseInt(cmdClean.substring(8)) || 100; setVolume(Math.min(150, Math.max(0, volVal))); setTimeout(() => { setDiscordChat(prev => [...prev, { id: `discord-bot-${Date.now()}`, author: { username: 'Glizh', avatar: '👑', isBot: true, colorClass: 'text-yellow-400 font-bold' }, timestamp: 'Hoy a las ' + new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}), embed: { title: `🔊 Volumen Ajustado`, description: `Se modificó la escala del volumen maestro a **${volVal}%**.`, color: 'border-yellow-500' } }]); setIsConsoleGenerating(false); }, 400); } else if (cmdClean.startsWith('/bassboost ')) { const boostVal = cmdClean.substring(11).toUpperCase(); setTimeout(() => { setDiscordChat(prev => [...prev, { id: `discord-bot-${Date.now()}`, author: { username: 'Glizh', avatar: '👑', isBot: true, colorClass: 'text-yellow-400 font-bold' }, timestamp: 'Hoy a las ' + new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}), embed: { title: `⚡ Filtro Bassboost Aplicado`, description: `Umbral dinámico configurado a: **${boostVal}**`, color: 'border-yellow-500' } }]); setIsConsoleGenerating(false); }, 400); } else { try { const response = await fetch('/api/music/chat', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ message: actualInput }) }); const data = await response.json(); if (data.error) throw new Error(data.error); setDiscordChat(prev => [...prev, { id: `discord-bot-${Date.now()}`, author: { username: 'Glizh', avatar: '👑', isBot: true, colorClass: 'text-yellow-400 font-bold' }, timestamp: 'Hoy a las ' + new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}), embed: { title: 'Sala de Chat Interactiva Glizh', description: data.text || '¡Alto y claro! El bot de música Glizh está listo.', color: 'border-yellow-500' } }]); } catch (err: any) { setDiscordChat(prev => [...prev, { id: `discord-bot-${Date.now()}`, author: { username: 'Glizh', avatar: '👑', isBot: true, colorClass: 'text-yellow-400 font-bold' }, timestamp: 'Hoy a las ' + new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}), content: `🎸 ¡Glizh está online! Prueba comandos como \`/play provenza\` o \`/queue\` en la consola del bot.` }]); } finally { setIsConsoleGenerating(false); } } }; // Submit Simulated Invite const handleSimulateInviteSubmit = () => { setInviteCompleted(true); setTimeout(() => { setShowInviteModal(false); setGuildName(inviteServerName); setInviteCompleted(false); alert(`¡Éxito! Glizh Bot se ha enlazado al servidor de Discord "${inviteServerName}".`); }, 1200); }; // Assistant chatbot trigger const handleSendAssistant = async () => { if (!assistantInput.trim()) return; const userText = assistantInput; setAssistantHistory(prev => [...prev, { sender: 'user', text: userText }]); setAssistantInput(''); setIsAssistantLoading(true); try { const response = await fetch('/api/music/chat', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ message: userText }) }); const data = await response.json(); if (data.error) throw new Error(data.error); setAssistantHistory(prev => [...prev, { sender: 'bot', text: data.text || 'He recibido tu solicitud.' }]); } catch (e) { setAssistantHistory(prev => [...prev, { sender: 'bot', text: '¡Hola! Estoy listo para sonar. Activa tu GEMINI_API_KEY para respuestas inteligentes.' }]); } finally { setIsAssistantLoading(false); } }; return (
{/* Dynamic Background Ambient Gold Glow */}
{/* Website Top Header Navbar */} {/* Main Container Content */}
{/* ======================================= */} {/* TAB 1: LANDING OVERVIEW PAGE */} {/* ======================================= */} {activeTab === 'home' && (
{/* Hero Splash Typography */}
Motor de Audio de Alta Fidelidad para Discord

Música Sin Límites en
tu Servidor de Discord

Conecta a tu comunidad con Glizh. Transmisión estéreo sin pérdidas (320kbps), ecualizadores premium, filtros dinámicos, control inteligente por comandos y listas curadas por IA con Gemini.

{/* Immersive Preview Showcase */}
VISTA PREVIA DEL REPRODUCTOR EN VIVO DE GLIZH
{/* Embedded Mini Player panel */}
Sonando ahora

{activeTrack?.title || 'Provenza'}

{activeTrack?.artist || 'KAROL G'}

Solicitado por: @cristophergamer
{formatTime(playProgress)} {activeTrack?.duration || '03:27'}
Vol: {volume}%
🟢 Link: Voice General
{/* Embedded Mini Queue listing */}

Lista de reproducción entrante

{songQueue.slice(0, 3).map((t, index) => (
[{index + 1}] {t.title}
{t.duration}
))}
¿Quieres ver la cola completa o cambiar de canción?
{/* Simulated Live Statistics */}
Servidores Activos {botStats.guilds.toLocaleString()}

Comunidades de Discord activas

Oyentes {(botStats.users / 1000).toFixed(0)}k+

Usuarios únicos en streaming hoy

Latencia {botStats.ping}ms

Excelente conexión y carga de buffer

Uptime {botStats.uptime}

Estabilidad garantizada 24/7

{/* Highlight Feature Bento grid */}

Diseñado Para La Excelencia Auditiva

Glizh elimina los saltos de audio y el lag para ofrecer una experiencia musical de primera clase.

Ecualizador Premium & Bassboost

Ajusta los bajos de forma masiva o aplica filtros dinámicos (Vaporwave, Nightcore, Lo-Fi) en tiempo real con comandos sencillos.

Audio Lossless a 320kbps

Transmisión de sonido sin pérdidas directamente a tus canales de voz, esquivando los filtros normales de compresión de Discord.

Co-Piloto Inteligente Gemini

Usa lenguaje natural directamente en el simulador para que Gemini AI genere y ponga en cola playlists personalizadas según tu estado de ánimo.

{/* Immersive Guild Switch Mock Selector */}
Conexión del simulador

🔊 Servidor enlazado: "{guildName}"

¿Quieres enlazar el reproductor virtual a otro servidor de tu propiedad?

)} {/* ======================================= */} {/* TAB 2: INTERACTIVE WEB MUSIC DASHBOARD */} {/* ======================================= */} {activeTab === 'dashboard' && (
{/* Left Column: Player controls & Active Visualizers */}
{/* High-Fi Music Master Player Card */}
Canal de Voz Conectado #01
Bajos: {bassboostMode} Filtro: {activeFilter}
{/* Disc and track core info */}
{isPlaying && (
)}
{activeTrack?.genre || 'Música Latina'}

{activeTrack ? activeTrack.title : 'Glizh Desconectado'}

de {activeTrack ? activeTrack.artist : 'Carga pistas para empezar'}

{activeTrack?.requester && (

Solicitado por: @{activeTrack.requester}

)}
{/* Timeline Progress Bar controls */}
setPlayProgress(Number(e.target.value))} className="w-full h-1 bg-white/5 rounded-lg appearance-none cursor-pointer accent-amber-500 outline-none" />
{formatTime(playProgress)} {activeTrack ? activeTrack.duration : '00:00'}
{/* Primary Music Controls Buttons Row */}
{/* Volume Slider scale controls */}
{volume}% setVolume(Number(e.target.value))} className="w-24 h-1 bg-white/10 rounded-lg appearance-none cursor-pointer accent-amber-500 outline-none" />
{/* Animated EQ Bars Gold */}
{/* Stateful EQ Filter Tuner deck */}

Filtros y Ecualización DSP del Canal

Ajustes instantáneos
{/* Bassboost tuner */}
Realce de Bajos (Equalizer)
{(['Off', 'Bass+ Low', 'Glizh Heavy'] as const).map(b => ( ))}
{/* High pass layout */}
Filtros Activos DSP
{(['None', 'Nightcore', 'Vaporwave', 'Lo-Fi Chill'] as const).map(f => ( ))}
{/* Browser Interactive Soundboard (Plays actual sounds via Synthesizer API) */}

Efectos de Sonido Directos

Efectos sintetizados directamente en tu navegador

Sin Latencia
{/* Right Column: Queue Manager, Manual Add, Gemini Recommender */}
{/* Queue List Panel */}

Canciones en la Cola ({songQueue.length})

{songQueue.map((t, index) => { const isActive = index === currentTrackIndex; return (
{ setCurrentTrackIndex(index); setPlayProgress(0); }} className={`p-3.5 rounded-xl border flex items-center justify-between gap-3 text-xs opacity-90 hover:opacity-100 cursor-pointer transition-all ${ isActive ? 'border-amber-500 bg-amber-500/10 text-white font-semibold' : 'border-white/5 bg-black/20 hover:border-neutral-700' }`} >
{isActive ? '🔊' : `[${index + 1}]`}
{t.title}

de {t.artist}

{t.requester && ( @{t.requester} )} {t.duration}
); })}
{/* Gemini AI Smart Playlist Spark (Suggest tracks) */}

Co-Piloto Inteligente Gemini

Escribe tu vibra o estilo musical en español (ej. "canciones de Karol G bailables" o "trap latino pesado") y deja que Gemini ponga temas realistas en la cola al instante.

setGeminiSearchQuery(e.target.value)} onKeyDown={(e) => e.key === 'Enter' && handleGeminiPlaylistSuggest()} placeholder="Ej: reggaeton bailable del 2020..." className="flex-1 bg-black/40 text-xs px-3 py-2.5 rounded-lg border border-white/5 outline-none focus:border-amber-500/50" disabled={isAiSuggesting} />
{isAiSuggesting && (
Generando lista de canciones mediante Gemini 3.5...
)}
{/* Queue Preset Accelerators */}
Paquetes de Estilo Musical Rápido
{/* Manual Add Item Form */}
Agregar Canción Manualmente
setManualTitle(e.target.value)} placeholder="Título de la canción..." className="bg-black/30 text-xs px-3 py-2 rounded-md border border-white/5 outline-none focus:border-amber-400 text-white" /> setManualArtist(e.target.value)} placeholder="Nombre del artista..." className="bg-black/30 text-xs px-3 py-2 rounded-md border border-white/5 outline-none focus:border-amber-400 text-white" />
)} {/* ======================================= */} {/* TAB 3: INTERACTIVE DISCORD CHAT CONSOLE */} {/* ======================================= */} {activeTab === 'console' && (
{/* Left Box: Active Command References */}

Referencia de Comandos

Escríbelos en el simulador o haz clic en ellos para ejecutarlos automáticamente.

{BOT_COMMANDS.map(cmd => (
{ setConsoleInput(cmd.syntax); triggerSFX('laser'); }} className="p-3 bg-neutral-950 hover:bg-neutral-900 border border-white/5 hover:border-amber-550 rounded-lg cursor-pointer transition-all space-y-1 block text-left" title="Clic para pegar sintaxis" >
/{cmd.name} {cmd.category}

{cmd.description}

Sintaxis: {cmd.syntax}
))}
{/* Right Box: Elegant Immersive Discord Text Client Simulator */}
{/* Discord Top Header simulation bar */}
#

glizh-chat-lounge

Canal de texto del simulador conectado a **"{guildName}"**

BOT EN: VOICE GENERAL
{/* Chat archives scroll panel */}
{discordChat.map((msg) => { return (
{msg.author.avatar}
{msg.author.username} {msg.author.isBot && ( BOT )} {msg.timestamp}
{msg.content && (

{msg.content}

)} {/* Discord Embed design rendering */} {msg.embed && (
{msg.embed.title && (
{msg.embed.title}
)} {msg.embed.description && (

{msg.embed.description}

)} {/* Embed Fields */} {msg.embed.fields && msg.embed.fields.length > 0 && (
{msg.embed.fields.map((f, i) => (
{f.name} {f.value}
))}
)} {msg.embed.footer && (
{msg.embed.footer}
)}
)}
); })} {/* Loading typing indicator */} {isConsoleGenerating && (
Glizh está procesando el flujo de audio...
)}
{/* Command preset rapid triggers bar */}
Acciones rápidas:
{/* AI helper questions presets */}
Preguntas sugeridas:
{/* Terminal simulated Input box */}
setConsoleInput(e.target.value)} onKeyDown={(e) => e.key === 'Enter' && handleSendConsole()} placeholder={`Enviar mensaje a #glizh-chat-lounge (o consulta al bot)...`} className="w-full bg-transparent border-none text-[#dbdee1] outline-none placeholder-neutral-500 text-xs" />
)}
{/* ======================================= */} {/* IMMERSIVE GATEWAY AUTHORIZATION DIALOG */} {/* ======================================= */} {showInviteModal && (
{/* Top auth aesthetic header strip */}
👑

Glizh Bot Shard Gateway

Autoriza la conexión de Glizh a tus servidores

{/* Simulated authorization checklists */}
Seleccionar Servidor de Destino setInviteServerName(e.target.value)} placeholder="e.g. Mi Servidor Dorado" className="w-full bg-[#1e1f22] border border-white/5 p-2 px-3 text-xs text-[#efefe1] outline-none rounded focus:border-amber-500" />
Permisos Requeridos
Crear comandos de barra /

Permite controlar colas de reproducción desde texto

Unirse a canales de voz

Transmisión lossless directa de 320kbps

Ecualización de audio

Modifica filtros graves o efectos Nightcore en vivo

{/* Submit simulation */}
)} {/* Botón flotante del Asistente de IA Glizh */}
{isAssistantOpen && (
{/* Cabecera */}

Asistente Glizh AI

En línea
{/* Mensajes */}
{assistantHistory.map((msg, index) => (
{msg.text}
))} {isAssistantLoading && (
Glizh está pensando...
)}
{/* Input */}
setAssistantInput(e.target.value)} onKeyDown={(e) => e.key === 'Enter' && handleSendAssistant()} placeholder="Pregúntale a Glizh AI..." className="flex-1 bg-black/40 text-xs px-3 py-2.5 rounded-lg border border-white/5 outline-none focus:border-amber-500/50 text-white placeholder-neutral-500" />
)}
{/* Futuristic clean footer */}
); }