diff options
Diffstat (limited to '')
| -rw-r--r-- | cogs/compression.py | 2 | ||||
| -rw-r--r-- | cogs/downloader.py | 1 | ||||
| -rw-r--r-- | cogs/math.py | 2 | ||||
| -rw-r--r-- | cogs/music/join.py | 3 | ||||
| -rw-r--r-- | cogs/music/play.py | 2 |
5 files changed, 6 insertions, 4 deletions
diff --git a/cogs/compression.py b/cogs/compression.py index 75eaf7c..dc8e632 100644 --- a/cogs/compression.py +++ b/cogs/compression.py | |||
| @@ -52,7 +52,7 @@ class Compression(commands.Cog): | |||
| 52 | # Execute ffmpeg command to compress video | 52 | # Execute ffmpeg command to compress video |
| 53 | ffmpeg_command = f"ffmpeg -i {input_path} -c:v libx264 -crf 51 -b:v 100 -vf 'fps=10' -preset ultrafast -c:a libopus -b:a 500 {output_path}" | 53 | ffmpeg_command = f"ffmpeg -i {input_path} -c:v libx264 -crf 51 -b:v 100 -vf 'fps=10' -preset ultrafast -c:a libopus -b:a 500 {output_path}" |
| 54 | elif file_type == "Audio": | 54 | elif file_type == "Audio": |
| 55 | ffmpeg_command = f"ffmpeg -i {input_path} -ar 8000 -ac 1 -b:a 16k -acodec libmp3lame -q:a 9 {output_path}" | 55 | ffmpeg_command = f"ffmpeg -i {input_path} -ac 1 -b:a 500 -acodec libopus {output_path}" |
| 56 | elif file_type == "Image": | 56 | elif file_type == "Image": |
| 57 | # Use ImageMagick's magick to heavily compress image (JPEG/PNG/GIF) | 57 | # Use ImageMagick's magick to heavily compress image (JPEG/PNG/GIF) |
| 58 | # For JPEG: quality 5, strip metadata, resize to 30% of the original size | 58 | # For JPEG: quality 5, strip metadata, resize to 30% of the original size |
diff --git a/cogs/downloader.py b/cogs/downloader.py index 9f825b4..7b338e9 100644 --- a/cogs/downloader.py +++ b/cogs/downloader.py | |||
| @@ -28,6 +28,7 @@ class Downloader(commands.Cog): | |||
| 28 | ): | 28 | ): |
| 29 | await ctx.defer() | 29 | await ctx.defer() |
| 30 | try: | 30 | try: |
| 31 | logger.info(f"Downloading {url}") | ||
| 31 | # Create a temporary directory | 32 | # Create a temporary directory |
| 32 | with tempfile.TemporaryDirectory() as temp_dir: | 33 | with tempfile.TemporaryDirectory() as temp_dir: |
| 33 | # Configure yt-dlp to use the temp directory | 34 | # Configure yt-dlp to use the temp directory |
diff --git a/cogs/math.py b/cogs/math.py index 123d7d0..8a2644c 100644 --- a/cogs/math.py +++ b/cogs/math.py | |||
| @@ -17,7 +17,7 @@ class Math(commands.Cog): | |||
| 17 | ) | 17 | ) |
| 18 | async def math(self, ctx: ApplicationContext, equation: str): | 18 | async def math(self, ctx: ApplicationContext, equation: str): |
| 19 | try: | 19 | try: |
| 20 | math = subprocess.check_output(f"qalc -e {equation}", shell=True) | 20 | math = subprocess.check_output(f"qalc -e '{equation}'", shell=True) |
| 21 | await ctx.respond(f"{equation} = {math.decode('utf-8').strip()}") | 21 | await ctx.respond(f"{equation} = {math.decode('utf-8').strip()}") |
| 22 | logger.info(f"Math command executed: {equation}") | 22 | logger.info(f"Math command executed: {equation}") |
| 23 | except Exception as e: | 23 | except Exception as e: |
diff --git a/cogs/music/join.py b/cogs/music/join.py index c626897..9837fdb 100644 --- a/cogs/music/join.py +++ b/cogs/music/join.py | |||
| @@ -11,7 +11,8 @@ class Join(commands.Cog): | |||
| 11 | 11 | ||
| 12 | @commands.slash_command(name="join", description="dołącza do kanalu") | 12 | @commands.slash_command(name="join", description="dołącza do kanalu") |
| 13 | async def join(self, ctx): | 13 | async def join(self, ctx): |
| 14 | await ctx.voice_client.connect() | 14 | channel = ctx.author.voice.channel |
| 15 | await channel.connect() | ||
| 15 | logger.info("Bot connected to voice channel") | 16 | logger.info("Bot connected to voice channel") |
| 16 | 17 | ||
| 17 | 18 | ||
diff --git a/cogs/music/play.py b/cogs/music/play.py index e75c91f..cf04ded 100644 --- a/cogs/music/play.py +++ b/cogs/music/play.py | |||
| @@ -85,7 +85,7 @@ class Play(commands.Cog): | |||
| 85 | 85 | ||
| 86 | if not result['result']: | 86 | if not result['result']: |
| 87 | await ctx.followup.send("nie znaleziono wideo dla twojego wyszukiwania.", ephemeral=True) | 87 | await ctx.followup.send("nie znaleziono wideo dla twojego wyszukiwania.", ephemeral=True) |
| 88 | logger.info(f"Could not find a video for your search: {search}") | 88 | logger.info(f"Could not find a video for search: {search}") |
| 89 | return | 89 | return |
| 90 | 90 | ||
| 91 | video = result['result'][0] | 91 | video = result['result'][0] |
