diff --git a/bot/__init__.py b/bot/__init__.py index e1fbe3e..2f280c3 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -1,6 +1,6 @@ import discord -__version__ = '1.0.3' +__version__ = '1.0.4' __author__ = 'Kartoniarz' diff --git a/bot/utils/helpers.py b/bot/utils/helpers.py index ac96ea4..d1d1664 100644 --- a/bot/utils/helpers.py +++ b/bot/utils/helpers.py @@ -5,7 +5,10 @@ import hashlib def rotate_downloads(downloads_dir: str): MAX_FILES = os.getenv('MAX_FILES') + if not MAX_FILES.isnumeric(): + return {'status': 'error', 'message': f'MAX_FILES: {MAX_FILES} - nie jest cyfrą.'} + MAX_FILES = int(MAX_FILES) files = [ os.path.join(downloads_dir, f) for f in os.listdir(downloads_dir) @@ -23,7 +26,7 @@ def rotate_downloads(downloads_dir: str): def download_video(yt_url: str) -> dict: MAX_DUR = os.getenv('MAX_DURATION') if not MAX_DUR.isnumeric(): - return {'status': 'error', 'message': f'MAX_DUR: {MAX_DUR} nie jest cyfrą.'} + return {'status': 'error', 'message': f'MAX_DUR: {MAX_DUR} - nie jest cyfrą.'} MAX_DUR = int(MAX_DUR) BASE_DIR = os.path.dirname(os.path.abspath(__file__))