Skip to content

Commit

Permalink
get urls from link_preview_options (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
travislee89 authored Oct 2, 2024
1 parent 2c9b135 commit 0159d6f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

version = '0.2.12'
version = '0.2.13'
message = ('*Tweet forward Bot*',
f'Version: {version}\n',
'*Usage:*',
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python-telegram-bot>=20.6
python-telegram-bot>=21.6
httpx[http2]
asyncio
uvicorn
Expand Down
2 changes: 2 additions & 0 deletions telebot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ async def get_urls(self, message: Message) -> list:
urls = await self.extract_url(message.text)
if not urls and message.caption:
urls = await self.extract_url(message.caption)
if not urls and message.link_preview_options and message.link_preview_options.url:
urls = await self.extract_url(message.link_preview_options.url)

if not urls:
self.logger.error('URL not found.')
Expand Down

0 comments on commit 0159d6f

Please sign in to comment.