Skip to content

Commit

Permalink
Another fix for sameDir incase tg-link range have pinned msg btw
Browse files Browse the repository at this point in the history
Signed-off-by: anasty17 <[email protected]>
  • Loading branch information
anasty17 committed Nov 9, 2023
1 parent d00f87c commit c40bd68
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions bot/modules/mirror_leech.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,10 @@ async def newEvent(self):
)

if file_ is None:
reply_text = reply_to.text.split("\n", 1)[0].strip()
if (
is_url(reply_text)
or is_magnet(reply_text)
or is_rclone_path(reply_text)
):
self.link = reply_text
if reply_text := reply_to.text:
self.link = reply_text.split("\n", 1)[0].strip()
else:
reply_to = None
elif reply_to.document and (
file_.mime_type == "application/x-bittorrent"
or file_.file_name.endswith(".torrent")
Expand All @@ -228,12 +225,15 @@ async def newEvent(self):
file_ = None

if (
not is_url(self.link)
not self.link
and file_ is None
or is_telegram_link(self.link)
and reply_to is None
or not is_url(self.link)
and not is_magnet(self.link)
and not await aiopath.exists(self.link)
and not is_rclone_path(self.link)
and not is_gdrive_id(self.link)
and file_ is None
):
await sendMessage(
self.message, "Open this link for usage help!", COMMAND_USAGE["main"]
Expand Down

0 comments on commit c40bd68

Please sign in to comment.