Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
- This fixes an issue where the bot was logging "Message to edit not found" error in every task of clone status function
- Removes replit support as it exposes credentials in public repl
  • Loading branch information
l3v11 committed Mar 29, 2022
1 parent 4fa3b11 commit 483cdc9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .replit

This file was deleted.

4 changes: 2 additions & 2 deletions bot/helper/telegram_helper/message_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def editMessage(text: str, message: Message, reply_markup=None):
reply_markup=reply_markup,
text=text, parse_mode='HTMl',
disable_web_page_preview=True)
except Exception as e:
LOGGER.error(str(e))
except Exception:
pass

def deleteMessage(bot, message: Message):
try:
Expand Down
4 changes: 2 additions & 2 deletions bot/modules/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ def sendCloneStatus(link, msg, status, context, update):
while not status.done():
time.sleep(3)
try:
statmsg = f"<b>Cloning:</b> <a href='{status.source_folder_link}'>{status.source_folder_name}</a>\n━━━━━━━━━━━━━━\n<b>Current file:</b> <code>{status.get_name()}</code>\n<b>Transferred</b>: <code>{status.get_size()}</code>"
statmsg = f"<b>Cloning:</b> <a href='{status.source_folder_link}'>{status.source_folder_name}</a>\n━━━━━━━━━━━━━━" \
f"\n<b>Current file:</b> <code>{status.get_name()}</code>\n<b>Transferred</b>: <code>{status.get_size()}</code>"
if not statmsg == old_statmsg:
editMessage(statmsg, msg)
old_statmsg = statmsg
except Exception as e:
LOGGER.error(str(e))
if str(e) == "Message to edit not found":
break
time.sleep(2)
Expand Down

0 comments on commit 483cdc9

Please sign in to comment.