diff options
| author | salmonik <raisersoft@proton.me> | 2026-01-15 14:37:22 +0100 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-01-15 14:37:22 +0100 |
| commit | edff41f3468996dad5e66d34ac8ab1f5a238751f (patch) | |
| tree | 33a567cd202fedf010764c3e4b8cae8827851f7f /cogs/compression.py | |
| parent | asyncio issues when starting (diff) | |
| download | senator-sperma-edff41f3468996dad5e66d34ac8ab1f5a238751f.tar.gz senator-sperma-edff41f3468996dad5e66d34ac8ab1f5a238751f.zip | |
minor improvements
Diffstat (limited to '')
| -rw-r--r-- | cogs/compression.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cogs/compression.py b/cogs/compression.py index 1905d74..79f79a0 100644 --- a/cogs/compression.py +++ b/cogs/compression.py | |||
| @@ -2,7 +2,7 @@ import mimetypes | |||
| 2 | import os | 2 | import os |
| 3 | import subprocess | 3 | import subprocess |
| 4 | from typing import List, Optional | 4 | from typing import List, Optional |
| 5 | 5 | from os import PathLike | |
| 6 | import discord | 6 | import discord |
| 7 | from discord.ext import commands | 7 | from discord.ext import commands |
| 8 | import logging | 8 | import logging |
| @@ -29,8 +29,9 @@ class Compression(commands.Cog): | |||
| 29 | 29 | ||
| 30 | async def _compress_attachment(self, attachment: discord.Attachment) -> Optional[discord.File]: | 30 | async def _compress_attachment(self, attachment: discord.Attachment) -> Optional[discord.File]: |
| 31 | """Compress a single attachment and return the compressed file""" | 31 | """Compress a single attachment and return the compressed file""" |
| 32 | file_path = PathLike[str] | ||
| 32 | try: | 33 | try: |
| 33 | file_path = os.path.join(self.temp_dir, attachment.filename) | 34 | file_path: PathLike[str] | str = os.path.join(self.temp_dir, attachment.filename) |
| 34 | output_path = os.path.join(self.temp_dir, f"better_{attachment.filename}") | 35 | output_path = os.path.join(self.temp_dir, f"better_{attachment.filename}") |
| 35 | 36 | ||
| 36 | # Save the original file | 37 | # Save the original file |
