warp-beacon 2.0.2__tar.gz → 2.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {warp_beacon-2.0.2/warp_beacon.egg-info → warp_beacon-2.0.3}/PKG-INFO +1 -1
- warp_beacon-2.0.3/warp_beacon/__version__.py +2 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/telegram/handlers.py +7 -2
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/telegram/utils.py +9 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3/warp_beacon.egg-info}/PKG-INFO +1 -1
- warp_beacon-2.0.2/warp_beacon/__version__.py +0 -2
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/LICENSE +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/MANIFEST.in +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/README.md +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/assets/placeholder.gif +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/etc/.gitignore +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/etc/warp_beacon.conf +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/etc/warp_beacon.service +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/pyproject.toml +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/setup.cfg +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/setup.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/__init__.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/compress/__init__.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/compress/video.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/jobs/__init__.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/jobs/abstract.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/jobs/download_job.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/jobs/types.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/jobs/upload_job.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/mediainfo/__init__.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/mediainfo/abstract.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/mediainfo/audio.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/mediainfo/silencer.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/mediainfo/video.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/scraper/__init__.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/scraper/abstract.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/scraper/exceptions.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/scraper/instagram.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/scraper/youtube/__init__.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/scraper/youtube/abstract.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/scraper/youtube/music.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/scraper/youtube/shorts.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/scraper/youtube/youtube.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/storage/__init__.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/telegram/__init__.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/telegram/bot.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/telegram/placeholder_message.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/uploader/__init__.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon/warp_beacon.py +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon.egg-info/SOURCES.txt +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon.egg-info/dependency_links.txt +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon.egg-info/entry_points.txt +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon.egg-info/requires.txt +0 -0
- {warp_beacon-2.0.2 → warp_beacon-2.0.3}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -17,6 +17,7 @@ import logging
|
|
17
17
|
class Handlers(object):
|
18
18
|
storage = None
|
19
19
|
bot = None
|
20
|
+
url_extractor = URLExtract()
|
20
21
|
|
21
22
|
def __init__(self, bot: "Bot") -> None:
|
22
23
|
self.bot = bot
|
@@ -55,10 +56,14 @@ class Handlers(object):
|
|
55
56
|
)
|
56
57
|
|
57
58
|
async def handler(self, client: Client, message: Message) -> None:
|
59
|
+
if message is None:
|
60
|
+
return
|
61
|
+
message_text = Utils.extract_message_text(message)
|
62
|
+
if not message_text:
|
63
|
+
return
|
58
64
|
chat = message.chat
|
59
65
|
effective_message_id = message.id
|
60
|
-
|
61
|
-
urls = extractor.find_urls(message.text)
|
66
|
+
urls = self.url_extractor.find_urls(message_text)
|
62
67
|
|
63
68
|
reply_text = "Wut?"
|
64
69
|
if not urls:
|
@@ -71,3 +71,12 @@ class Utils(object):
|
|
71
71
|
@staticmethod
|
72
72
|
def chunker(seq: list, size: int) -> list:
|
73
73
|
return (seq[pos:pos + size] for pos in range(0, len(seq), size))
|
74
|
+
|
75
|
+
@staticmethod
|
76
|
+
def extract_message_text(message: "Message") -> str:
|
77
|
+
if hasattr(message, "text") and message.text:
|
78
|
+
return message.text
|
79
|
+
if hasattr(message, "caption") and message.caption:
|
80
|
+
return message.caption
|
81
|
+
|
82
|
+
return ''
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|