From 07e32c1a1df09d7add424b556fa91d18c554143a Mon Sep 17 00:00:00 2001 From: Marcin Macierzanka Date: Sat, 23 May 2026 14:37:16 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20default=20volume=20to=20100%,=20transl?= =?UTF-8?q?ate=20discord=20logs=20to=20Polish,=20rename=20project=20to=20?= =?UTF-8?q?=C5=BByrarBOT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 98 +++++++++++++++++++++++------------------------ compose.yaml | 2 +- static/app.js | 2 +- static/index.html | 10 ++--- web.py | 10 ++--- 5 files changed, 61 insertions(+), 61 deletions(-) diff --git a/bot.py b/bot.py index d64fbe4..06f37e0 100644 --- a/bot.py +++ b/bot.py @@ -17,7 +17,7 @@ class MusicBot(commands.Cog): self.bot = bot self.queue = [] self.current = None - self.volume = 0.5 + self.volume = 1.0 # Domyślna głośność ustawiona na 100% (1.0) self.loop_current = False self.last_channel = None @@ -68,7 +68,7 @@ class MusicBot(commands.Cog): async def ensure_voice(self, interaction): if not interaction.user.voice: await interaction.response.send_message( - "You are not connected to a voice channel", + "Nie jesteś połączony z kanałem głosowym.", ephemeral=True ) return False @@ -77,17 +77,17 @@ class MusicBot(commands.Cog): await interaction.user.voice.channel.connect() elif interaction.guild.voice_client.channel != interaction.user.voice.channel: await interaction.response.send_message( - "I'm already in another voice channel", + "Jestem już połączony z innym kanałem głosowym.", ephemeral=True ) return False return True - @app_commands.command(name="play", description="Play a song from YouTube") - @app_commands.describe(query="YouTube URL or search query") + @app_commands.command(name="play", description="Odtwórz utwór z YouTube") + @app_commands.describe(query="Link YouTube lub zapytanie wyszukiwania") async def play(self, interaction: discord.Interaction, query: str): - """Play a song from YouTube""" + """Odtwórz utwór z YouTube""" if not await self.ensure_voice(interaction): return @@ -100,7 +100,7 @@ class MusicBot(commands.Cog): if interaction.guild.voice_client.is_playing(): self.queue.append(player) await interaction.followup.send( - f"Added to queue: {player.title}", + f"Dodano do kolejki: {player.title}", ephemeral=False ) else: @@ -113,12 +113,12 @@ class MusicBot(commands.Cog): ) ) await interaction.followup.send( - f"Now playing: {player.title}", + f"Teraz odtwarzane: {player.title}", ephemeral=False ) except Exception as e: await interaction.followup.send( - f"An error occurred: {e}", + f"Wystąpił błąd: {e}", ephemeral=True ) @@ -140,7 +140,7 @@ class MusicBot(commands.Cog): self.bot.loop ) ) - await self.send_to_last_channel(f"Now playing (looped): {self.current.title}") + await self.send_to_last_channel(f"Teraz odtwarzane (zapętlone): {self.current.title}") return except Exception as e: print(f"Error repeating song: {e}") @@ -154,10 +154,10 @@ class MusicBot(commands.Cog): self.bot.loop ) ) - await self.send_to_last_channel(f"Now playing: {self.current.title}") + await self.send_to_last_channel(f"Teraz odtwarzane: {self.current.title}") else: self.current = None - await self.send_to_last_channel("Queue is empty") + await self.send_to_last_channel("Kolejka jest pusta.") async def send_to_last_channel(self, text): channel = self.get_notification_channel() @@ -167,86 +167,86 @@ class MusicBot(commands.Cog): except Exception as e: print(f"Failed to send message: {e}") - @app_commands.command(name="queue", description="Show the current queue") + @app_commands.command(name="queue", description="Pokaż aktualną kolejkę") async def show_queue(self, interaction: discord.Interaction): - """Show the current queue""" + """Pokaż aktualną kolejkę""" if not self.queue: await interaction.response.send_message( - "The queue is empty", + "Kolejka jest pusta.", ephemeral=True ) return queue_list = "\n".join([f"{i + 1}. {item.title}" for i, item in enumerate(self.queue)]) await interaction.response.send_message( - f"Current queue:\n{queue_list}", + f"Aktualna kolejka:\n{queue_list}", ephemeral=False ) - @app_commands.command(name="skip", description="Skip the current song") + @app_commands.command(name="skip", description="Pomiń aktualny utwór") async def skip(self, interaction: discord.Interaction): - """Skip the current song""" + """Pomiń aktualny utwór""" if interaction.guild.voice_client.is_playing(): interaction.guild.voice_client.stop() await interaction.response.send_message( - "Skipped current song", + "Pominięto aktualny utwór.", ephemeral=False ) else: await interaction.response.send_message( - "Not playing anything", + "Nic nie jest odtwarzane.", ephemeral=True ) - @app_commands.command(name="pause", description="Pause the current song") + @app_commands.command(name="pause", description="Wstrzymaj odtwarzanie") async def pause(self, interaction: discord.Interaction): - """Pause the current song""" + """Wstrzymaj odtwarzanie""" if interaction.guild.voice_client.is_playing(): interaction.guild.voice_client.pause() await interaction.response.send_message( - "Paused", + "Odtwarzanie wstrzymane.", ephemeral=False ) else: await interaction.response.send_message( - "Not playing anything", + "Nic nie jest odtwarzane.", ephemeral=True ) - @app_commands.command(name="resume", description="Resume the current song") + @app_commands.command(name="resume", description="Wznów odtwarzanie") async def resume(self, interaction: discord.Interaction): - """Resume the current song""" + """Wznów odtwarzanie""" if interaction.guild.voice_client.is_paused(): interaction.guild.voice_client.resume() await interaction.response.send_message( - "Resumed", + "Odtwarzanie wznowione.", ephemeral=False ) else: await interaction.response.send_message( - "Not paused", + "Odtwarzanie nie jest wstrzymane.", ephemeral=True ) - @app_commands.command(name="stop", description="Stop playback and clear queue") + @app_commands.command(name="stop", description="Zatrzymaj odtwarzanie i wyczyść kolejkę") async def stop(self, interaction: discord.Interaction): - """Stop playback and clear queue""" + """Zatrzymaj odtwarzanie i wyczyść kolejkę""" if interaction.guild.voice_client.is_playing(): interaction.guild.voice_client.stop() self.queue.clear() self.current = None await interaction.response.send_message( - "Stopped and cleared queue", + "Zatrzymano odtwarzanie i wyczyszczono kolejkę.", ephemeral=False ) - @app_commands.command(name="volume", description="Change the player volume") - @app_commands.describe(volume="The volume level (1-100)") + @app_commands.command(name="volume", description="Zmień głośność odtwarzacza") + @app_commands.describe(volume="Poziom głośności (1-100)") async def volume(self, interaction: discord.Interaction, volume: int): - """Change the player volume""" + """Zmień głośność odtwarzacza""" if interaction.guild.voice_client is None: return await interaction.response.send_message( - "Not connected to a voice channel", + "Nie połączono z kanałem głosowym.", ephemeral=True ) @@ -254,55 +254,55 @@ class MusicBot(commands.Cog): self.volume = volume / 100 interaction.guild.voice_client.source.volume = self.volume await interaction.response.send_message( - f"Changed volume to {volume}%", + f"Zmieniono głośność na {volume}%", ephemeral=False ) return None else: await interaction.response.send_message( - "Please enter a value between 1 and 100", + "Wprowadź wartość z przedziału od 1 do 100.", ephemeral=True ) return None - @app_commands.command(name="nowplaying", description="Show the currently playing song") + @app_commands.command(name="nowplaying", description="Pokaż aktualnie odtwarzany utwór") async def now_playing(self, interaction: discord.Interaction): - """Show the currently playing song""" + """Pokaż aktualnie odtwarzany utwór""" if self.current: await interaction.response.send_message( - f"Now playing: {self.current.title}", + f"Teraz odtwarzane: {self.current.title}", ephemeral=False ) else: await interaction.response.send_message( - "Nothing is currently playing", + "Nic nie jest obecnie odtwarzane.", ephemeral=True ) - @app_commands.command(name="leave", description="Leave the voice channel") + @app_commands.command(name="leave", description="Odłącz bota od kanału głosowego") async def leave(self, interaction: discord.Interaction): - """Leave the voice channel""" + """Odłącz bota od kanału głosowego""" if interaction.guild.voice_client is not None: await interaction.guild.voice_client.disconnect() self.queue.clear() self.current = None await interaction.response.send_message( - "Left the voice channel", + "Rozłączono z kanału głosowego.", ephemeral=False ) else: await interaction.response.send_message( - "I'm not in a voice channel", + "Nie jestem na kanale głosowym.", ephemeral=True ) - @app_commands.command(name="loop", description="Toggle loop for the current song") + @app_commands.command(name="loop", description="Włącz/wyłącz zapętlanie aktualnego utworu") async def loop_command(self, interaction: discord.Interaction): - """Toggle loop for the current song""" + """Włącz/wyłącz zapętlanie aktualnego utworu""" self.loop_current = not self.loop_current - state = "enabled" if self.loop_current else "disabled" + state = "włączone" if self.loop_current else "wyłączone" await interaction.response.send_message( - f"Looping for the current song is now {state}.", + f"Zapętlanie aktualnego utworu zostało {state}.", ephemeral=False ) diff --git a/compose.yaml b/compose.yaml index bfda2e3..e1f6157 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,7 +3,7 @@ services: build: context: . dockerfile: Dockerfile - container_name: vibe-bot + container_name: zyrarbot ports: - "80:8000" environment: diff --git a/static/app.js b/static/app.js index 5424878..49da1b6 100644 --- a/static/app.js +++ b/static/app.js @@ -1,7 +1,7 @@ // Global variables let isDragging = false; let currentStatus = null; -let currentVolume = 50; +let currentVolume = 100; let isUpdatingVolume = false; // DOM Elements diff --git a/static/index.html b/static/index.html index ef80fa9..654ace9 100644 --- a/static/index.html +++ b/static/index.html @@ -3,7 +3,7 @@ - VibeBot - Dashboard Kolejki + ŻyrarBOT - Dashboard Kolejki @@ -24,8 +24,8 @@
-

VibeBot

- Web Controller +

ŻyrarBOT

+ Kontroler Web
@@ -116,8 +116,8 @@ - - 50% + + 100%
diff --git a/web.py b/web.py index 3fb35e9..ff4e9b0 100644 --- a/web.py +++ b/web.py @@ -9,7 +9,7 @@ from bot import bot from ytdl import YTDLSource # Initialize FastAPI application -app = FastAPI(title="VibeBot Queue Controller") +app = FastAPI(title="ŻyrarBOT Queue Controller") # FastAPI Request Models class PlayRequest(BaseModel): @@ -119,7 +119,7 @@ async def api_play(req: PlayRequest): if voice_client.is_playing() or voice_client.is_paused(): music_cog.queue.append(player) - await music_cog.send_to_last_channel(f"Added to queue (Web): {player.title}") + await music_cog.send_to_last_channel(f"Dodano do kolejki (Web): {player.title}") return {"status": "queued", "title": player.title} else: music_cog.current = player @@ -130,7 +130,7 @@ async def api_play(req: PlayRequest): bot.loop ) ) - await music_cog.send_to_last_channel(f"Now playing (Web): {player.title}") + await music_cog.send_to_last_channel(f"Teraz odtwarzane (Web): {player.title}") return {"status": "playing", "title": player.title} except Exception as e: raise HTTPException(status_code=500, detail=str(e)) @@ -284,9 +284,9 @@ async def api_set_text_channel(req: TextChannelRequest): music_cog.last_channel = channel music_cog.save_channel_id(int(req.channel_id)) - # Send test message to confirm + # Send test message to confirm in Polish with new bot name try: - await channel.send(f"🔔 Ten kanał został ustawiony jako główny kanał powiadomień dla VibeBot z panelu webowego.") + await channel.send(f"🔔 Ten kanał został ustawiony jako główny kanał powiadomień dla ŻyrarBOT z panelu webowego.") except Exception as e: print(f"Failed to send test message: {e}")