diff options
author | Mole Shang <[email protected]> | 2023-01-25 15:56:12 +0800 |
---|---|---|
committer | Mole Shang <[email protected]> | 2023-01-25 15:56:12 +0800 |
commit | b6d4781af03497c19442cc2081790793bbe25e87 (patch) | |
tree | 3bee1850ddbf4654cb90d85c1d30140722f09a3f | |
parent | be447d0ea7fc30b7bd7bdfe730532f20a3f00b77 (diff) | |
download | telegram-mail-bot-b6d4781af03497c19442cc2081790793bbe25e87.tar.gz telegram-mail-bot-b6d4781af03497c19442cc2081790793bbe25e87.tar.bz2 telegram-mail-bot-b6d4781af03497c19442cc2081790793bbe25e87.zip |
fix(box.py): correct range logic when receiving more than one emails
-rw-r--r-- | bot.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -90,8 +90,8 @@ async def periodic_task(context: CallbackContext) -> None: with EmailClient(email_addr, email_passwd) as client: new_inbox_num = client.get_mails_count() if new_inbox_num > inbox_num: - for i in range(inbox_num, inbox_num + new_inbox_num): - mail = client.get_mail_by_index(i + 1) + for i in range(inbox_num, new_inbox_num + 1): + mail = client.get_mail_by_index(i) content = mail.__repr__() for text in handle_large_text(content): await context.bot.send_message(context.job.chat_id, text=text) |