diff --git a/bot/modules/mirror.py b/bot/modules/mirror.py index 606ab0a9109..c69dee9e690 100644 --- a/bot/modules/mirror.py +++ b/bot/modules/mirror.py @@ -149,6 +149,12 @@ def onUploadProgress(self): def onUploadComplete(self, link: str, size, files, folders, typ): with download_dict_lock: msg = f'Filename: {download_dict[self.uid].name()}\nSize: {size}' + if os.path.isdir(f'{DOWNLOAD_DIR}/{self.uid}/{download_dict[self.uid].name()}'): + msg += '\n\nType: Folder' + msg += f'\nSubFolders: {folders}' + msg += f'\nFiles: {files}' + else: + msg += f'\n\nType: {typ}' buttons = button_build.ButtonMaker() if SHORTENER is not None and SHORTENER_API is not None: surl = requests.get('https://{}/api?api={}&url={}&format=text'.format(SHORTENER, SHORTENER_API, link)).text @@ -161,11 +167,6 @@ def onUploadComplete(self, link: str, size, files, folders, typ): share_url = f'{INDEX_URL}/{url_path}' if os.path.isdir(f'{DOWNLOAD_DIR}/{self.uid}/{download_dict[self.uid].name()}'): share_url += '/' - msg += '\n\nType: Folder' - msg += f'\nSubFolders: {folders}' - msg += f'\nFiles: {files}' - else: - msg += f'\n\nType: {typ}' if SHORTENER is not None and SHORTENER_API is not None: siurl = requests.get('https://{}/api?api={}&url={}&format=text'.format(SHORTENER, SHORTENER_API, share_url)).text buttons.buildbutton("⚡Index Link⚡", siurl)