warp-beacon 2.3.13__py3-none-any.whl → 2.3.14__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.13"
1
+ __version__ = "2.3.14"
2
2
 
@@ -71,19 +71,19 @@ class Utils(object):
71
71
 
72
72
  @staticmethod
73
73
  def extract_message_author(message: Message) -> str:
74
- if message.from_user:
75
- if message.from_user.username:
76
- return message.from_user.username
77
- if message.from_user.first_name:
78
- return message.from_user.first_name
79
- if message.from_user.id:
80
- return str(message.from_user.mention(style=enums.ParseMode.HTML))
81
- if message.sender_chat:
82
- if message.sender_chat.username:
83
- return message.sender_chat.username
84
- if message.sender_chat.title:
85
- return message.sender_chat.title
86
- return ''
74
+ #if message.from_user:
75
+ # if message.from_user.username:
76
+ # return message.from_user.username
77
+ # if message.from_user.first_name:
78
+ # return message.from_user.first_name
79
+ # if message.from_user.id:
80
+ return str(message.from_user.mention(style=enums.ParseMode.HTML))
81
+ #if message.sender_chat:
82
+ # if message.sender_chat.username:
83
+ # return message.sender_chat.username
84
+ # if message.sender_chat.title:
85
+ # return message.sender_chat.title
86
+ #return ''
87
87
 
88
88
  @staticmethod
89
89
  def compute_leftover(urls: list, message: str) -> str:
@@ -107,6 +107,10 @@ class Utils(object):
107
107
  @staticmethod
108
108
  async def handle_mentions(chat_id: int, client: Client, message: str) -> str:
109
109
  try:
110
+ mentions = Utils.mention_re.findall(message)
111
+ if not mentions:
112
+ return message
113
+
110
114
  logging.info("Processing chat_id: '%s'", str(chat_id))
111
115
  chat = await client.get_chat(chat_id)
112
116
  chat_id = chat.id
@@ -118,7 +122,6 @@ class Utils(object):
118
122
 
119
123
  username = ''
120
124
  members = [member async for member in client.get_chat_members(chat_id)]
121
- mentions = Utils.mention_re.findall(message)
122
125
  for mention in mentions:
123
126
  username = mention[1:].strip()
124
127
  if username:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: warp_beacon
3
- Version: 2.3.13
3
+ Version: 2.3.14
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=SvYyCmpESQQDFw3ipWnDZ2_z5YrFNpHWnKvL17dpQzw,24
7
+ warp_beacon/__version__.py,sha256=iJ-Q1BLOe6hox693J7orVPTRwodzQ-BF6JHxjBKJRBs,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
@@ -39,11 +39,11 @@ warp_beacon/telegram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
39
39
  warp_beacon/telegram/bot.py,sha256=u3yvXIcqFtVkrf82IXiC4y-UnrEySw49_immBoXIBN4,15725
40
40
  warp_beacon/telegram/handlers.py,sha256=7gldKrX-CTDQNfD1NQ08cC31uPR-95mhN59OujAEqZg,7704
41
41
  warp_beacon/telegram/placeholder_message.py,sha256=wN9-BRiyrtHG-EvXtZkGJHt2CX71munQ57ITttjt0mw,6400
42
- warp_beacon/telegram/utils.py,sha256=YoCITXrz5sS-63o_Xtl5dFXZh0W5G9vxI4el961wkkw,4390
42
+ warp_beacon/telegram/utils.py,sha256=9uebX53G16mV7ER7WgfdWBLFHHw14S8HBt9URrIskg0,4440
43
43
  warp_beacon/uploader/__init__.py,sha256=5KRWsxPRGuQ56YhCEnJsXnb-yQp8dpvWEsPDf0dD-fw,4964
44
- warp_beacon-2.3.13.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
45
- warp_beacon-2.3.13.dist-info/METADATA,sha256=vj0CPRmTaWO3jAc8jiCWcNFGIv2ySMpDWus02QuCmug,21704
46
- warp_beacon-2.3.13.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
47
- warp_beacon-2.3.13.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
48
- warp_beacon-2.3.13.dist-info/top_level.txt,sha256=XusFB1mGUStI2gqbtRuJzQrfrAXmdMaT3QTyfvdLEXI,1064
49
- warp_beacon-2.3.13.dist-info/RECORD,,
44
+ warp_beacon-2.3.14.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
45
+ warp_beacon-2.3.14.dist-info/METADATA,sha256=pePZ8lNGtYb8zk8jQERG5QtOkogr_MlshyE976i-xsU,21704
46
+ warp_beacon-2.3.14.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
47
+ warp_beacon-2.3.14.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
48
+ warp_beacon-2.3.14.dist-info/top_level.txt,sha256=XusFB1mGUStI2gqbtRuJzQrfrAXmdMaT3QTyfvdLEXI,1064
49
+ warp_beacon-2.3.14.dist-info/RECORD,,