Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageNotModified Fixed #16

Merged
merged 1 commit into from
Feb 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bot/helper/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from bot import data, download_dir
from pyrogram.types import Message
from pyrogram.errors.exceptions.bad_request_400 import MessageNotModified
from .ffmpeg_utils import encode, get_thumbnail, get_duration, get_width_height

def on_task_complete():
Expand All @@ -27,6 +28,8 @@ def add_task(message: Message):
else:
msg.edit("```Something wents wrong while encoding your file. Make sure it is not already in HEVC format.```")
os.remove(filepath)
except MessageNotModified:
pass
except Exception as e:
msg.edit(f"```{e}```")
on_task_complete()
on_task_complete()