From 791e75cb2beeca45a6edf52b65f7e299e03b5eaf Mon Sep 17 00:00:00 2001 From: SamlonDev Date: Sat, 14 Jun 2025 18:54:02 +0200 Subject: code-style issues --- cogs/music/play_compressed.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'cogs/music/play_compressed.py') diff --git a/cogs/music/play_compressed.py b/cogs/music/play_compressed.py index 3297110..f14d75b 100644 --- a/cogs/music/play_compressed.py +++ b/cogs/music/play_compressed.py @@ -1,15 +1,18 @@ -import discord -from discord.ext import commands import asyncio import os import subprocess + +import discord +from discord.ext import commands from youtubesearchpython import VideosSearch + class GrajcujZkompresowane(commands.Cog): def __init__(self, bot): self.bot = bot - def prepend_title_to_file(self, file_path, title): + @staticmethod + def prepend_title_to_file(file_path, title): try: with open(file_path, 'rb') as original: data = original.read() @@ -19,7 +22,8 @@ class GrajcujZkompresowane(commands.Cog): except Exception as e: print(f"Failed to prepend title: {e}") - def compress_audio(self, input_path): + @staticmethod + def compress_audio(input_path): base, ext = os.path.splitext(input_path) output_path = f"{base}_compressed{ext}" ffmpeg_command = f"ffmpeg -i {input_path} -ar 8000 -ac 1 -b:a 500 -acodec libmp3lame -q:a 9 {output_path}" @@ -84,5 +88,6 @@ class GrajcujZkompresowane(commands.Cog): else: await ctx.followup.send(f"dodano do koleyjki (zkompresowane): {title}") + def setup(bot): - bot.add_cog(GrajcujZkompresowane(bot)) \ No newline at end of file + bot.add_cog(GrajcujZkompresowane(bot)) -- cgit v1.2.3