reywechat 1.0.55__py3-none-any.whl → 1.0.57__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.
- reywechat/rdb.py +2 -2
- reywechat/rreceive.py +40 -15
- reywechat/rsend.py +66 -0
- {reywechat-1.0.55.dist-info → reywechat-1.0.57.dist-info}/METADATA +1 -1
- {reywechat-1.0.55.dist-info → reywechat-1.0.57.dist-info}/RECORD +7 -7
- {reywechat-1.0.55.dist-info → reywechat-1.0.57.dist-info}/WHEEL +0 -0
- {reywechat-1.0.55.dist-info → reywechat-1.0.57.dist-info}/licenses/LICENSE +0 -0
reywechat/rdb.py
CHANGED
@@ -318,8 +318,8 @@ class WeChatDatabase(WeChatBase):
|
|
318
318
|
'50 is voice call or video call invitation message, '
|
319
319
|
'51 is system synchronize data message, '
|
320
320
|
'56 is real time position data message, '
|
321
|
-
'
|
322
|
-
'
|
321
|
+
'10000 is system message, '
|
322
|
+
'10002 is pat or recall message, '
|
323
323
|
'other omit.'
|
324
324
|
)
|
325
325
|
},
|
reywechat/rreceive.py
CHANGED
@@ -185,7 +185,8 @@ class WeChatMessage(WeChatBase):
|
|
185
185
|
self._is_call_next: bool | None = None
|
186
186
|
self._is_last_call: bool | None = None
|
187
187
|
self._is_pat: bool | None = None
|
188
|
-
self.
|
188
|
+
self._is_pat_me: bool | None = None
|
189
|
+
self._pat_text: str | None = None
|
189
190
|
self._is_recall: bool | None = None
|
190
191
|
self._is_new_user: bool | None = None
|
191
192
|
self._is_new_room: bool | None = None
|
@@ -377,7 +378,7 @@ class WeChatMessage(WeChatBase):
|
|
377
378
|
|
378
379
|
### File uploaded.
|
379
380
|
elif self.is_file_uploaded:
|
380
|
-
self._text = f'[文件"{self.file['name']}"
|
381
|
+
self._text = f'[文件"{self.file['name']}"发送完成]'
|
381
382
|
|
382
383
|
### Initiate real time location.
|
383
384
|
elif self.share_type == 17:
|
@@ -420,7 +421,7 @@ class WeChatMessage(WeChatBase):
|
|
420
421
|
|
421
422
|
### File uploading.
|
422
423
|
elif self.is_file_uploading:
|
423
|
-
self._text = f'[文件"{self.file_name_uploading}"
|
424
|
+
self._text = f'[文件"{self.file_name_uploading}"发送中]'
|
424
425
|
|
425
426
|
### Transfer money.
|
426
427
|
elif self.is_money:
|
@@ -461,19 +462,16 @@ class WeChatMessage(WeChatBase):
|
|
461
462
|
self._text = '[实时地图位置分享中]'
|
462
463
|
|
463
464
|
## System.
|
464
|
-
case
|
465
|
+
case 10000:
|
465
466
|
self._text = '[系统信息]'
|
466
467
|
|
467
|
-
##
|
468
|
-
case
|
469
|
-
|
470
|
-
### Pat.
|
471
|
-
if self.is_pat:
|
472
|
-
self._text = f'[{self.pat_text}]'
|
468
|
+
## Pat.
|
469
|
+
case 10002 if self.is_pat:
|
470
|
+
self._text = f'[{self.pat_text}]'
|
473
471
|
|
474
|
-
|
475
|
-
|
476
|
-
|
472
|
+
## Recall.
|
473
|
+
case 10002 if self.is_recall:
|
474
|
+
self._text = '[撤回了一条消息]'
|
477
475
|
|
478
476
|
case _:
|
479
477
|
self._text = '[消息]'
|
@@ -992,7 +990,7 @@ class WeChatMessage(WeChatBase):
|
|
992
990
|
return self._is_call
|
993
991
|
|
994
992
|
# Text.
|
995
|
-
if self.type in (1, 3, 34, 42, 43, 47, 48, 49, 50, 56,
|
993
|
+
if self.type in (1, 3, 34, 42, 43, 47, 48, 49, 50, 56, 10002):
|
996
994
|
text = self.text
|
997
995
|
text = text.strip()
|
998
996
|
else:
|
@@ -1027,6 +1025,9 @@ class WeChatMessage(WeChatBase):
|
|
1027
1025
|
## Private chat.
|
1028
1026
|
or self.room is None
|
1029
1027
|
|
1028
|
+
## Pat me.
|
1029
|
+
or self.is_pat_me
|
1030
|
+
|
1030
1031
|
## At self.
|
1031
1032
|
or is_at_me
|
1032
1033
|
|
@@ -1152,6 +1153,30 @@ class WeChatMessage(WeChatBase):
|
|
1152
1153
|
return self._is_pat
|
1153
1154
|
|
1154
1155
|
|
1156
|
+
@property
|
1157
|
+
def is_pat_me(self) -> bool:
|
1158
|
+
"""
|
1159
|
+
Whether if is message of pat me.
|
1160
|
+
|
1161
|
+
Returns
|
1162
|
+
-------
|
1163
|
+
Judge result.
|
1164
|
+
"""
|
1165
|
+
|
1166
|
+
# Cache.
|
1167
|
+
if self._is_pat_me is not None:
|
1168
|
+
return self._is_pat_me
|
1169
|
+
|
1170
|
+
# Judge.
|
1171
|
+
pattern = r'<template><!\[CDATA\["\$\{[\da-z_]+\}" 拍了拍我\]\]></template>'
|
1172
|
+
self._is_pat_me = (
|
1173
|
+
self.is_pat
|
1174
|
+
and search(pattern, self.data) is not None
|
1175
|
+
)
|
1176
|
+
|
1177
|
+
return self._is_pat_me
|
1178
|
+
|
1179
|
+
|
1155
1180
|
@property
|
1156
1181
|
def pat_text(self) -> str:
|
1157
1182
|
"""
|
@@ -1177,7 +1202,7 @@ class WeChatMessage(WeChatBase):
|
|
1177
1202
|
text: str = search(pattern, self.data)
|
1178
1203
|
|
1179
1204
|
## User name.
|
1180
|
-
pattern = r'"\$\{([
|
1205
|
+
pattern = r'"\$\{([\da-z_]+)\}"'
|
1181
1206
|
users_id: list[str] = findall(pattern, text)
|
1182
1207
|
for user_id in users_id:
|
1183
1208
|
user_name = self.receiver.wechat.client.get_contact_name(user_id)
|
reywechat/rsend.py
CHANGED
@@ -194,6 +194,72 @@ class WeChatSendParameter(WeChatBase):
|
|
194
194
|
self.exc_reports: list[str] = []
|
195
195
|
self.status: WeChatSendStatusEnum
|
196
196
|
|
197
|
+
## Cache.
|
198
|
+
self._text: str | None = None
|
199
|
+
|
200
|
+
|
201
|
+
@property
|
202
|
+
def text(self) -> str:
|
203
|
+
"""
|
204
|
+
Text description of parameter content.
|
205
|
+
|
206
|
+
Returns
|
207
|
+
-------
|
208
|
+
Text.
|
209
|
+
"""
|
210
|
+
|
211
|
+
# Cache.
|
212
|
+
if self._text is not None:
|
213
|
+
return self._text
|
214
|
+
|
215
|
+
# Get.
|
216
|
+
match self.send_type:
|
217
|
+
|
218
|
+
## Text.
|
219
|
+
case WeChatSendTypeEnum.TEXT:
|
220
|
+
self._text = self.params['text']
|
221
|
+
|
222
|
+
## Text with '@'.
|
223
|
+
case WeChatSendTypeEnum.TEXT_AT:
|
224
|
+
self._text = self.params['text']
|
225
|
+
|
226
|
+
## File.
|
227
|
+
case WeChatSendTypeEnum.FILE:
|
228
|
+
self._text = f'[文件"{self.params['file_name']}"发送]'
|
229
|
+
|
230
|
+
## Image.
|
231
|
+
case WeChatSendTypeEnum.IMAGE:
|
232
|
+
self._text = f'[图片"{self.params['file_name']}"发送]'
|
233
|
+
|
234
|
+
## Emotion.
|
235
|
+
case WeChatSendTypeEnum.EMOTION:
|
236
|
+
self._text = f'[动画表情"{self.params['file_name']}"发送]'
|
237
|
+
|
238
|
+
## Pat.
|
239
|
+
case WeChatSendTypeEnum.PAT:
|
240
|
+
user_name = self.sender.wechat.client.get_contact_name(self.params['user_id'])
|
241
|
+
self._text = f'[我拍了拍"{user_name}"]'
|
242
|
+
|
243
|
+
## Public account.
|
244
|
+
case WeChatSendTypeEnum.PUBLIC:
|
245
|
+
self._text = f'[公众号"{self.params['title']}"分享]'
|
246
|
+
public_name = self.params.get('public_name')
|
247
|
+
text = self.params.get('public_name')
|
248
|
+
if public_name is not None:
|
249
|
+
self._text += f' {public_name}'
|
250
|
+
if text is not None:
|
251
|
+
self._text += f' {text}'
|
252
|
+
|
253
|
+
## Forward.
|
254
|
+
case WeChatSendTypeEnum.FORWARD:
|
255
|
+
self._text = '[转发了一条消息]'
|
256
|
+
|
257
|
+
## Throw exception.
|
258
|
+
case send_type:
|
259
|
+
throw(ValueError, send_type)
|
260
|
+
|
261
|
+
return self._text
|
262
|
+
|
197
263
|
|
198
264
|
class WeChatSender(WeChatBase):
|
199
265
|
"""
|
@@ -3,14 +3,14 @@ reywechat/rall.py,sha256=5J_X-XMOyb1Vp1jyS9-oRFXGOtp2vRPX1g3tJot_Eck,371
|
|
3
3
|
reywechat/rbase.py,sha256=hbxn5spvcl_C_Bw8A9teulOXT9GMlxUw145_YbXIOzc,1124
|
4
4
|
reywechat/rcache.py,sha256=7UsHHfgFOgxuSqlTSAO6CprgUUOeBCXYus0kxmRBQxk,908
|
5
5
|
reywechat/rclient.py,sha256=lc1CPle9h08mwP8NlJN0ybzcNJxtpV0ma6q6cz1RIxk,22518
|
6
|
-
reywechat/rdb.py,sha256=
|
6
|
+
reywechat/rdb.py,sha256=4or5HV_U4mZwRSiK1fa1wZkhh_KfdtkYoWkEdBDov_Q,48351
|
7
7
|
reywechat/rlog.py,sha256=4EsTgrgC05JvWeKAucUaWGga638CRRJISJN6qncBCAw,5249
|
8
|
-
reywechat/rreceive.py,sha256=
|
9
|
-
reywechat/rsend.py,sha256=
|
8
|
+
reywechat/rreceive.py,sha256=nNSBDfCwFUK2eiDRgLey1o6uQ4GaaQLGpwrsHjB6nbU,51581
|
9
|
+
reywechat/rsend.py,sha256=yrJf9GzWVCDptUHHazhWSVW0nm2LCIbb0sz2EII63bY,20049
|
10
10
|
reywechat/rtrigger.py,sha256=WdOQwobPdGPyyE9J-qtQFPd60713T0aWqKk02PLdCRE,4966
|
11
11
|
reywechat/rwechat.py,sha256=g0pbprMPv_qWb_lGFrPDAWsJO4vPSIgFLkw0Y28CZUo,4751
|
12
12
|
reywechat/data/client_api.dll,sha256=H9uj-x9Ztg0jFZK0yY6NsnyH5_119dQRFfoVVMidxRs,592384
|
13
|
-
reywechat-1.0.
|
14
|
-
reywechat-1.0.
|
15
|
-
reywechat-1.0.
|
16
|
-
reywechat-1.0.
|
13
|
+
reywechat-1.0.57.dist-info/METADATA,sha256=9lWZLh4_IdPQ6gTZNmnN0SSBpioFASdjwpmpEjHLO4E,1551
|
14
|
+
reywechat-1.0.57.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
+
reywechat-1.0.57.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
16
|
+
reywechat-1.0.57.dist-info/RECORD,,
|
File without changes
|
File without changes
|