aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalmonik <raisersoft@proton.me>2025-10-02 12:54:18 +0200
committersalmonik <raisersoft@proton.me>2025-10-02 12:54:18 +0200
commit342d1e34a3fb039b6b47269df25422882edca78b (patch)
tree6903aa82a74c888dd41252a684e4fee9a96e0dfa
parentadded playing from file (diff)
downloadsenator-sperma-342d1e34a3fb039b6b47269df25422882edca78b.tar.gz
senator-sperma-342d1e34a3fb039b6b47269df25422882edca78b.zip
added argument support for conversion.py
-rw-r--r--cogs/conversion.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cogs/conversion.py b/cogs/conversion.py
index 4d5d4d9..deb7c80 100644
--- a/cogs/conversion.py
+++ b/cogs/conversion.py
@@ -35,7 +35,7 @@ class Conversion(commands.Cog):
35 required=True, 35 required=True,
36 type=str 36 type=str
37 ) 37 )
38 async def convert(self, ctx, plik, output_format): 38 async def convert(self, ctx, plik, output_format, args):
39 await ctx.defer() 39 await ctx.defer()
40 # Save files to the temp directory inside the bot's root directory 40 # Save files to the temp directory inside the bot's root directory
41 bot_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 41 bot_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -52,9 +52,9 @@ class Conversion(commands.Cog):
52 logger.info(f"Conversion started for: {file_type}") 52 logger.info(f"Conversion started for: {file_type}")
53 if file_type == "Video" or file_type == "Audio": 53 if file_type == "Video" or file_type == "Audio":
54 # Execute ffmpeg command to compress video 54 # Execute ffmpeg command to compress video
55 ffmpeg_command = f"ffmpeg -i {input_path} {output_path}" 55 ffmpeg_command = f"ffmpeg -i {input_path} {args} {output_path}"
56 elif file_type == "Image": 56 elif file_type == "Image":
57 img_command = f"magick {input_path} {output_path}" 57 img_command = f"magick {input_path} {args} {output_path}"
58 ffmpeg_command = img_command 58 ffmpeg_command = img_command
59 else: 59 else:
60 await ctx.respond("Plik jest nieobsługiwany", ephemeral=True) 60 await ctx.respond("Plik jest nieobsługiwany", ephemeral=True)