warp-beacon 2.3.22__py3-none-any.whl → 2.3.23__py3-none-any.whl

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.
@@ -1,2 +1,2 @@
1
- __version__ = "2.3.22"
1
+ __version__ = "2.3.23"
2
2
 
@@ -91,6 +91,7 @@ class Bot(object):
91
91
  self.client.add_handler(MessageHandler(self.handlers.help, filters.command("help")))
92
92
  self.client.add_handler(MessageHandler(self.handlers.random, filters.command("random")))
93
93
  self.client.add_handler(MessageHandler(self.handlers.handler))
94
+ #TODO refactor to callback router
94
95
  self.client.add_handler(CallbackQueryHandler(self.handlers.simple_button_handler, filters=filters.create(lambda _, __, q: not q.data.startswith("read_more:"))))
95
96
  self.client.add_handler(CallbackQueryHandler(self.handlers.read_more_handler, filters=filters.create(lambda _, __, q: q.data.startswith("read_more:"))))
96
97
 
@@ -245,11 +245,27 @@ class Handlers(object):
245
245
  first_entity = db_results[0]
246
246
 
247
247
  try:
248
+ text = first_entity.get("canonical_name", "Failed to fetch data.")
249
+ if len(text) > 200:
250
+ text = text[:134] + "... \nText exceeds Telegram's limits. Use 'source link' in message."
248
251
  await client.answer_callback_query(
249
252
  callback_query_id=query.id,
250
253
  show_alert=True,
251
- text=first_entity.get("canonical_name", "Failed to fetch data.")
254
+ text=text
252
255
  )
253
256
  except Exception as e:
254
- logging.warning("read_more_handler: Failed for uniq_id='%s', origin='%s", uniq_id, origin)
255
- logging.exception(e)
257
+ logging.warning("read_more_handler: Failed for uniq_id='%s', origin='%s'", uniq_id, origin)
258
+ logging.exception(e)
259
+
260
+ try:
261
+ error_text = str(e)
262
+ if len(error_text) > 200:
263
+ error_text = error_text[:197] + "..."
264
+
265
+ await client.answer_callback_query(
266
+ callback_query_id=query.id,
267
+ show_alert=True,
268
+ text=error_text
269
+ )
270
+ except Exception as _:
271
+ pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: warp_beacon
3
- Version: 2.3.22
3
+ Version: 2.3.23
4
4
  Summary: Telegram bot for expanding external media links
5
5
  Home-page: https://github.com/sb0y/warp_beacon
6
6
  Author: Andrey Bagrintsev
@@ -4,7 +4,7 @@ var/warp_beacon/accounts.json,sha256=OsXdncs6h88xrF_AP6_WDCK1waGBn9SR-uYdIeK37GM
4
4
  var/warp_beacon/placeholder.gif,sha256=cE5CGJVaop4Sx21zx6j4AyoHU0ncmvQuS2o6hJfEH88,6064
5
5
  var/warp_beacon/proxies.json,sha256=VnjlQDXumOEq72ZFjbh6IqHS1TEHqn8HPYAZqWCeSIA,95
6
6
  warp_beacon/__init__.py,sha256=_rThNODmz0nDp_n4mWo_HKaNFE5jk1_7cRhHyYaencI,163
7
- warp_beacon/__version__.py,sha256=K-gR7pjA4PhxFmv2BmDHgWMBSnNUUYNiCESv-qN1hZE,24
7
+ warp_beacon/__version__.py,sha256=UXTGdNzHbVz-t0lUkxpvpPc5wkOHbaYl5uqcE8KcgE4,24
8
8
  warp_beacon/warp_beacon.py,sha256=7KEtZDj-pdhtl6m-zFLsSojs1ZR4o7L0xbqtdmYPvfE,342
9
9
  warp_beacon/compress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  warp_beacon/compress/video.py,sha256=_PDMVYCyzLYxHv1uZmmzGcG_8rjaZr7BTXsXTTy_oS4,2846
@@ -36,15 +36,15 @@ warp_beacon/scraper/youtube/youtube.py,sha256=fGrbjBngvvNdpzhb1yZVedNW0_tCrLc31V
36
36
  warp_beacon/storage/__init__.py,sha256=0Vajd0oITKJfu2vmNx5uQSt3-L6vwIvUYWJo8HZCjco,3398
37
37
  warp_beacon/storage/mongo.py,sha256=qC4ZiO8XXvPnP0rJwz4CJx42pqFsyAjCiW10W5QdT6E,527
38
38
  warp_beacon/telegram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
- warp_beacon/telegram/bot.py,sha256=Ldl3MxARyO1EBqJRZdpazgM1JrHsND2VXTJ1CK18bkk,16475
39
+ warp_beacon/telegram/bot.py,sha256=I-KPdeg-LMRb6wRRn2MLHndz9zhgSTBkxOhNQyWZwKI,16511
40
40
  warp_beacon/telegram/caption_shortener.py,sha256=6J4Dp35mOmJEyctiuN8WXM39bkQ13m78HoghsYX3fbU,1548
41
- warp_beacon/telegram/handlers.py,sha256=JVlPbqGG3hXIvROceo_tZAu99yoiLyLbMY3TcTj5SOM,8766
41
+ warp_beacon/telegram/handlers.py,sha256=6uyyU4dbRyIYHTnCl1grO95cU7INECfoAEZ84kmelXs,9163
42
42
  warp_beacon/telegram/placeholder_message.py,sha256=wN9-BRiyrtHG-EvXtZkGJHt2CX71munQ57ITttjt0mw,6400
43
43
  warp_beacon/telegram/utils.py,sha256=9uebX53G16mV7ER7WgfdWBLFHHw14S8HBt9URrIskg0,4440
44
44
  warp_beacon/uploader/__init__.py,sha256=5KRWsxPRGuQ56YhCEnJsXnb-yQp8dpvWEsPDf0dD-fw,4964
45
- warp_beacon-2.3.22.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
46
- warp_beacon-2.3.22.dist-info/METADATA,sha256=h2kESijehZjya2RCIP49t0puX9EJ088t83ahS4SzQP4,21723
47
- warp_beacon-2.3.22.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
48
- warp_beacon-2.3.22.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
49
- warp_beacon-2.3.22.dist-info/top_level.txt,sha256=2iKFlYwJ-meO9sCX4OGEP1hhQN17t2KFksQ5dXMhXUA,1103
50
- warp_beacon-2.3.22.dist-info/RECORD,,
45
+ warp_beacon-2.3.23.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
46
+ warp_beacon-2.3.23.dist-info/METADATA,sha256=jROYnnpf4BMQ2CqcvjDA2c9q1CxHKZrNzpGvF0tA6V4,21723
47
+ warp_beacon-2.3.23.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
48
+ warp_beacon-2.3.23.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
49
+ warp_beacon-2.3.23.dist-info/top_level.txt,sha256=2iKFlYwJ-meO9sCX4OGEP1hhQN17t2KFksQ5dXMhXUA,1103
50
+ warp_beacon-2.3.23.dist-info/RECORD,,