No need for buttons if only 1 page

Signed-off-by: anas <e.anastayyar@gmail.com>
This commit is contained in:
anas 2021-07-16 15:45:43 +03:00
parent dcdbbccb68
commit 6f85fdc6ea
2 changed files with 10 additions and 10 deletions

View File

@ -138,18 +138,18 @@ def get_readable_message():
msg += f"\n<b>To Stop:</b> <code>/{BotCommands.CancelMirror} {download.gid()}</code>"
msg += "\n\n"
if STATUS_LIMIT is not None:
limit = COUNT + STATUS_LIMIT
if INDEX >= limit:
if INDEX >= COUNT + STATUS_LIMIT:
break
if STATUS_LIMIT is not None:
if INDEX > limit:
if INDEX > COUNT + STATUS_LIMIT:
return None, None
msg += f"Page: {PAGE_NO}/{pages} | Tasks: {dick_no}\n"
buttons = button_build.ButtonMaker()
buttons.sbutton("Previous", "pre")
buttons.sbutton("Next", "nex")
button = InlineKeyboardMarkup(buttons.build_menu(2))
return msg, button
if dick_no > STATUS_LIMIT:
msg += f"Page: {PAGE_NO}/{pages} | Tasks: {dick_no}\n"
buttons = button_build.ButtonMaker()
buttons.sbutton("Previous", "pre")
buttons.sbutton("Next", "nex")
button = InlineKeyboardMarkup(buttons.build_menu(2))
return msg, button
return msg, ""
def flip(update, context):

View File

@ -61,7 +61,7 @@ class AriaDownloadHelper(DownloadHelper):
dl.getListener().onDownloadError(f'{mssg}.\nYour File/Folder size is {get_readable_file_size(size)}')
aria2.remove([download], force=True)
return
update_all_messages()
update_all_messages()
def __onDownloadComplete(self, api: API, gid):
dl = getDownloadByGid(gid)