reywechat 1.0.78__py3-none-any.whl → 1.0.80__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/rclient.py +19 -19
- reywechat/rdb.py +17 -17
- reywechat/rlog.py +1 -1
- reywechat/rreceive.py +2 -2
- reywechat/rsend.py +3 -3
- reywechat/rtrigger.py +1 -1
- reywechat/rwechat.py +1 -1
- {reywechat-1.0.78.dist-info → reywechat-1.0.80.dist-info}/METADATA +1 -1
- reywechat-1.0.80.dist-info/RECORD +16 -0
- reywechat-1.0.78.dist-info/RECORD +0 -16
- {reywechat-1.0.78.dist-info → reywechat-1.0.80.dist-info}/WHEEL +0 -0
- {reywechat-1.0.78.dist-info → reywechat-1.0.80.dist-info}/licenses/LICENSE +0 -0
reywechat/rclient.py
CHANGED
@@ -212,7 +212,7 @@ class WeChatClient(WeChatBase):
|
|
212
212
|
Inject DLL file of start API into the WeChat client process.
|
213
213
|
"""
|
214
214
|
|
215
|
-
#
|
215
|
+
# Set parameter.
|
216
216
|
dll_file_relpath = './data/client_api.dll'
|
217
217
|
dll_file_path = find_relpath(__file__, dll_file_relpath)
|
218
218
|
|
@@ -251,7 +251,7 @@ class WeChatClient(WeChatBase):
|
|
251
251
|
Client response content dictionary.
|
252
252
|
"""
|
253
253
|
|
254
|
-
#
|
254
|
+
# Set parameter.
|
255
255
|
url = f'http://127.0.0.1:{self.client_api_port}/api/{api}'
|
256
256
|
data = data or {}
|
257
257
|
if type(success_code) == int:
|
@@ -299,7 +299,7 @@ class WeChatClient(WeChatBase):
|
|
299
299
|
Check result.
|
300
300
|
"""
|
301
301
|
|
302
|
-
#
|
302
|
+
# Set parameter.
|
303
303
|
api = 'checkLogin'
|
304
304
|
|
305
305
|
# Request.
|
@@ -352,7 +352,7 @@ class WeChatClient(WeChatBase):
|
|
352
352
|
- `Key 'decrypt_key'`: Database decrypt key.
|
353
353
|
"""
|
354
354
|
|
355
|
-
#
|
355
|
+
# Set parameter.
|
356
356
|
api = 'userInfo'
|
357
357
|
|
358
358
|
# Request.
|
@@ -402,7 +402,7 @@ class WeChatClient(WeChatBase):
|
|
402
402
|
timeout : Request timeout seconds.
|
403
403
|
"""
|
404
404
|
|
405
|
-
#
|
405
|
+
# Set parameter.
|
406
406
|
api = 'hookSyncMsg'
|
407
407
|
port = str(port)
|
408
408
|
timeout_ms_str = str(int(timeout * 1000))
|
@@ -440,7 +440,7 @@ class WeChatClient(WeChatBase):
|
|
440
440
|
Unhook the message.
|
441
441
|
"""
|
442
442
|
|
443
|
-
#
|
443
|
+
# Set parameter.
|
444
444
|
api = 'unhookSyncMsg'
|
445
445
|
|
446
446
|
# Request.
|
@@ -462,7 +462,7 @@ class WeChatClient(WeChatBase):
|
|
462
462
|
id\\_ : Message ID.
|
463
463
|
"""
|
464
464
|
|
465
|
-
#
|
465
|
+
# Set parameter.
|
466
466
|
api = 'downloadAttach'
|
467
467
|
data = {'msgId': id_}
|
468
468
|
|
@@ -484,7 +484,7 @@ class WeChatClient(WeChatBase):
|
|
484
484
|
dir\\_ : Save directory.
|
485
485
|
"""
|
486
486
|
|
487
|
-
#
|
487
|
+
# Set parameter.
|
488
488
|
api = 'getVoiceByMsgId'
|
489
489
|
dir_ = os_abspath(dir_)
|
490
490
|
data = {
|
@@ -517,7 +517,7 @@ class WeChatClient(WeChatBase):
|
|
517
517
|
- `Key 'name'`: User nickname or chat room name.
|
518
518
|
"""
|
519
519
|
|
520
|
-
#
|
520
|
+
# Set parameter.
|
521
521
|
api = 'getContactList'
|
522
522
|
filter_names = {
|
523
523
|
'filehelper': '朋友推荐消息',
|
@@ -586,7 +586,7 @@ class WeChatClient(WeChatBase):
|
|
586
586
|
User nickname or chat room name.
|
587
587
|
"""
|
588
588
|
|
589
|
-
#
|
589
|
+
# Set parameter.
|
590
590
|
api = 'getContactProfile'
|
591
591
|
data = {'wxid': id_}
|
592
592
|
|
@@ -619,7 +619,7 @@ class WeChatClient(WeChatBase):
|
|
619
619
|
List of chat room member user ID.
|
620
620
|
"""
|
621
621
|
|
622
|
-
#
|
622
|
+
# Set parameter.
|
623
623
|
api = 'getMemberFromChatRoom'
|
624
624
|
data = {'chatRoomId': room_id}
|
625
625
|
|
@@ -683,7 +683,7 @@ class WeChatClient(WeChatBase):
|
|
683
683
|
if text == '':
|
684
684
|
throw(ValueError, text)
|
685
685
|
|
686
|
-
#
|
686
|
+
# Set parameter.
|
687
687
|
api = 'sendTextMsg'
|
688
688
|
data = {
|
689
689
|
'wxid': receive_id,
|
@@ -717,7 +717,7 @@ class WeChatClient(WeChatBase):
|
|
717
717
|
if text == '':
|
718
718
|
throw(ValueError, text)
|
719
719
|
|
720
|
-
#
|
720
|
+
# Set parameter.
|
721
721
|
api = 'sendAtText'
|
722
722
|
if type(user_id) != str:
|
723
723
|
user_id = ','.join(user_id)
|
@@ -745,7 +745,7 @@ class WeChatClient(WeChatBase):
|
|
745
745
|
path : Message file path.
|
746
746
|
"""
|
747
747
|
|
748
|
-
#
|
748
|
+
# Set parameter.
|
749
749
|
api = 'sendFileMsg'
|
750
750
|
data = {
|
751
751
|
'wxid': receive_id,
|
@@ -770,7 +770,7 @@ class WeChatClient(WeChatBase):
|
|
770
770
|
path : Message image file path.
|
771
771
|
"""
|
772
772
|
|
773
|
-
#
|
773
|
+
# Set parameter.
|
774
774
|
api = 'sendImagesMsg'
|
775
775
|
data = {
|
776
776
|
'wxid': receive_id,
|
@@ -795,7 +795,7 @@ class WeChatClient(WeChatBase):
|
|
795
795
|
path : Message emotion file path.
|
796
796
|
"""
|
797
797
|
|
798
|
-
#
|
798
|
+
# Set parameter.
|
799
799
|
api = 'sendCustomEmotion'
|
800
800
|
data = {
|
801
801
|
'wxid': receive_id,
|
@@ -820,7 +820,7 @@ class WeChatClient(WeChatBase):
|
|
820
820
|
user_id : User ID of pat.
|
821
821
|
"""
|
822
822
|
|
823
|
-
#
|
823
|
+
# Set parameter.
|
824
824
|
api = 'sendPatMsg'
|
825
825
|
data = {
|
826
826
|
'wxid': receive_id,
|
@@ -855,7 +855,7 @@ class WeChatClient(WeChatBase):
|
|
855
855
|
public_id : Control public account ID.
|
856
856
|
"""
|
857
857
|
|
858
|
-
#
|
858
|
+
# Set parameter.
|
859
859
|
text = text or ''
|
860
860
|
image_url = image_url or ''
|
861
861
|
public_name = public_name or ''
|
@@ -889,7 +889,7 @@ class WeChatClient(WeChatBase):
|
|
889
889
|
message_id : Forward message ID.
|
890
890
|
"""
|
891
891
|
|
892
|
-
#
|
892
|
+
# Set parameter.
|
893
893
|
api = 'sendImagesMsg'
|
894
894
|
data = {
|
895
895
|
'wxid': receive_id,
|
reywechat/rdb.py
CHANGED
@@ -93,7 +93,7 @@ class WeChatDatabase(WeChatBase):
|
|
93
93
|
|
94
94
|
def build_db(self) -> None:
|
95
95
|
"""
|
96
|
-
Check and build
|
96
|
+
Check and build database tables, by `self.db_names`.
|
97
97
|
"""
|
98
98
|
|
99
99
|
# Check.
|
@@ -759,7 +759,7 @@ class WeChatDatabase(WeChatBase):
|
|
759
759
|
## Insert.
|
760
760
|
if contact_table != []:
|
761
761
|
conn.execute.insert(
|
762
|
-
|
762
|
+
self.db_names['wechat.contact_user'],
|
763
763
|
user_data,
|
764
764
|
'update'
|
765
765
|
)
|
@@ -815,7 +815,7 @@ class WeChatDatabase(WeChatBase):
|
|
815
815
|
## Insert.
|
816
816
|
if contact_table != []:
|
817
817
|
conn.execute.insert(
|
818
|
-
|
818
|
+
self.db_names['wechat.contact_room'],
|
819
819
|
room_data,
|
820
820
|
'update'
|
821
821
|
)
|
@@ -893,7 +893,7 @@ class WeChatDatabase(WeChatBase):
|
|
893
893
|
## Insert.
|
894
894
|
if room_user_data != []:
|
895
895
|
conn.execute.insert(
|
896
|
-
|
896
|
+
self.db_names['wechat.contact_room_user'],
|
897
897
|
room_user_data,
|
898
898
|
'update'
|
899
899
|
)
|
@@ -961,7 +961,7 @@ class WeChatDatabase(WeChatBase):
|
|
961
961
|
|
962
962
|
## Insert.
|
963
963
|
self.database_wechat.execute.insert(
|
964
|
-
|
964
|
+
self.db_names['wechat.contact_user'],
|
965
965
|
data,
|
966
966
|
'update'
|
967
967
|
)
|
@@ -1002,7 +1002,7 @@ class WeChatDatabase(WeChatBase):
|
|
1002
1002
|
|
1003
1003
|
### 'contact_room'.
|
1004
1004
|
self.database_wechat.execute.insert(
|
1005
|
-
|
1005
|
+
self.db_names['wechat.contact_room'],
|
1006
1006
|
data,
|
1007
1007
|
'update'
|
1008
1008
|
)
|
@@ -1024,7 +1024,7 @@ class WeChatDatabase(WeChatBase):
|
|
1024
1024
|
|
1025
1025
|
## Update.
|
1026
1026
|
self.database_wechat.execute.update(
|
1027
|
-
|
1027
|
+
self.db_names['wechat.contact_room'],
|
1028
1028
|
data
|
1029
1029
|
)
|
1030
1030
|
|
@@ -1046,7 +1046,7 @@ class WeChatDatabase(WeChatBase):
|
|
1046
1046
|
|
1047
1047
|
## Update.
|
1048
1048
|
self.database_wechat.execute.update(
|
1049
|
-
|
1049
|
+
self.db_names['wechat.contact_room'],
|
1050
1050
|
data
|
1051
1051
|
)
|
1052
1052
|
|
@@ -1126,7 +1126,7 @@ class WeChatDatabase(WeChatBase):
|
|
1126
1126
|
|
1127
1127
|
# Insert.
|
1128
1128
|
self.database_wechat.execute.insert(
|
1129
|
-
|
1129
|
+
self.db_names['wechat.message_receive'],
|
1130
1130
|
data,
|
1131
1131
|
'ignore'
|
1132
1132
|
)
|
@@ -1156,7 +1156,7 @@ class WeChatDatabase(WeChatBase):
|
|
1156
1156
|
if send_params.status != WeChatSendStatusEnum.SENT:
|
1157
1157
|
return
|
1158
1158
|
|
1159
|
-
#
|
1159
|
+
# Set parameter.
|
1160
1160
|
if send_params.exc_reports == []:
|
1161
1161
|
status = 2
|
1162
1162
|
else:
|
@@ -1169,7 +1169,7 @@ class WeChatDatabase(WeChatBase):
|
|
1169
1169
|
|
1170
1170
|
# Update.
|
1171
1171
|
self.database_wechat.execute.update(
|
1172
|
-
|
1172
|
+
self.db_names['wechat.message_send'],
|
1173
1173
|
data
|
1174
1174
|
)
|
1175
1175
|
|
@@ -1223,7 +1223,7 @@ class WeChatDatabase(WeChatBase):
|
|
1223
1223
|
Read record from table `message_send`, put send queue.
|
1224
1224
|
"""
|
1225
1225
|
|
1226
|
-
#
|
1226
|
+
# Set parameter.
|
1227
1227
|
conn = self.database_wechat.connect()
|
1228
1228
|
|
1229
1229
|
# Read.
|
@@ -1237,7 +1237,7 @@ class WeChatDatabase(WeChatBase):
|
|
1237
1237
|
')'
|
1238
1238
|
)
|
1239
1239
|
result = conn.execute.select(
|
1240
|
-
|
1240
|
+
self.db_names['wechat.message_send'],
|
1241
1241
|
['send_id', 'type', 'receive_id', 'parameter', 'file_id'],
|
1242
1242
|
where,
|
1243
1243
|
order='`plan_time` DESC, `send_id`'
|
@@ -1322,7 +1322,7 @@ class WeChatDatabase(WeChatBase):
|
|
1322
1322
|
## User.
|
1323
1323
|
if message.room is None:
|
1324
1324
|
result = message.receiver.wechat.database.database_wechat.execute.select(
|
1325
|
-
|
1325
|
+
self.db_names['wechat.message_send'],
|
1326
1326
|
['valid'],
|
1327
1327
|
'`user_id` = :user_id',
|
1328
1328
|
limit=1,
|
@@ -1332,7 +1332,7 @@ class WeChatDatabase(WeChatBase):
|
|
1332
1332
|
## Room.
|
1333
1333
|
elif message.user is None:
|
1334
1334
|
result = message.receiver.wechat.database.database_wechat.execute.select(
|
1335
|
-
|
1335
|
+
self.db_names['wechat.message_send'],
|
1336
1336
|
['valid'],
|
1337
1337
|
'`room_id` = :room_id',
|
1338
1338
|
limit=1,
|
@@ -1377,7 +1377,7 @@ class WeChatDatabase(WeChatBase):
|
|
1377
1377
|
send_params : `WeChatSendParameters` instance.
|
1378
1378
|
"""
|
1379
1379
|
|
1380
|
-
#
|
1380
|
+
# Set parameter.
|
1381
1381
|
params = send_params.params.copy()
|
1382
1382
|
data = {
|
1383
1383
|
'status': 0,
|
@@ -1409,6 +1409,6 @@ class WeChatDatabase(WeChatBase):
|
|
1409
1409
|
|
1410
1410
|
# Insert.
|
1411
1411
|
self.database_wechat.execute.insert(
|
1412
|
-
|
1412
|
+
self.db_names['wechat.message_send'],
|
1413
1413
|
data
|
1414
1414
|
)
|
reywechat/rlog.py
CHANGED
reywechat/rreceive.py
CHANGED
@@ -169,7 +169,7 @@ class WeChatMessage(WeChatBase):
|
|
169
169
|
Parameters dictionary.
|
170
170
|
"""
|
171
171
|
|
172
|
-
#
|
172
|
+
# Set parameter.
|
173
173
|
params: MessageParameters = {
|
174
174
|
'time': self.time,
|
175
175
|
'id': self.id,
|
@@ -1496,7 +1496,7 @@ class WeChatMessage(WeChatBase):
|
|
1496
1496
|
- When no match, then return `None`.
|
1497
1497
|
"""
|
1498
1498
|
|
1499
|
-
#
|
1499
|
+
# Set parameter.
|
1500
1500
|
text = text or self.data
|
1501
1501
|
|
1502
1502
|
# Search.
|
reywechat/rsend.py
CHANGED
@@ -521,7 +521,7 @@ class WeChatSender(WeChatBase):
|
|
521
521
|
params : Send parameters.
|
522
522
|
"""
|
523
523
|
|
524
|
-
#
|
524
|
+
# Set parameter.
|
525
525
|
send_params = WeChatSendParameters(
|
526
526
|
self,
|
527
527
|
send_type,
|
@@ -578,7 +578,7 @@ class WeChatSender(WeChatBase):
|
|
578
578
|
Added text.
|
579
579
|
"""
|
580
580
|
|
581
|
-
#
|
581
|
+
# Set parameter.
|
582
582
|
member_dict = self.wechat.client.get_room_member_dict(room_id)
|
583
583
|
login_id = self.wechat.client.login_info['id']
|
584
584
|
if login_id in member_dict:
|
@@ -617,7 +617,7 @@ class WeChatSender(WeChatBase):
|
|
617
617
|
Decorated function.
|
618
618
|
"""
|
619
619
|
|
620
|
-
#
|
620
|
+
# Set parameter.
|
621
621
|
if type(receive_id) == str:
|
622
622
|
receive_ids = [receive_id]
|
623
623
|
else:
|
reywechat/rtrigger.py
CHANGED
@@ -135,7 +135,7 @@ class WeChatTrigger(WeChatBase):
|
|
135
135
|
is_reply : Whehter is reply function, allow call `WeChatMessage.reply`, can only reply once function.
|
136
136
|
"""
|
137
137
|
|
138
|
-
#
|
138
|
+
# Set parameter.
|
139
139
|
rule: TriggerRule = {
|
140
140
|
'level': level,
|
141
141
|
'execute': execute,
|
reywechat/rwechat.py
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
reywechat/__init__.py,sha256=FXc3XSiPLLmz9bgZdiYKxeWX-7VT9RqPc_EkXp3Kk0I,476
|
2
|
+
reywechat/rall.py,sha256=5J_X-XMOyb1Vp1jyS9-oRFXGOtp2vRPX1g3tJot_Eck,371
|
3
|
+
reywechat/rbase.py,sha256=hbxn5spvcl_C_Bw8A9teulOXT9GMlxUw145_YbXIOzc,1124
|
4
|
+
reywechat/rcache.py,sha256=5FIa8UB3VsLHT_EXHHmFP62a5AeS22anJCJXC8t4tWw,908
|
5
|
+
reywechat/rclient.py,sha256=j4ktgD2l1W9ktrTtfQfyIXCxc7KnT-gvqgy8-zRq8IU,22655
|
6
|
+
reywechat/rdb.py,sha256=0wEsAr3FB-g0DPpU42XgpLqY9kzRbAaaba_Zl02mN_Q,50426
|
7
|
+
reywechat/rlog.py,sha256=JnzuSfQCKnvASPjZw9KrLTX9TjT79KLbciu8XeIA_88,5256
|
8
|
+
reywechat/rreceive.py,sha256=pgbRfkI7aXcC9-wUAueGcBdob4TsGbrMv33IfvGPbqU,50966
|
9
|
+
reywechat/rsend.py,sha256=niYmnbm4uzhp5Qh86EMMB39wn37k3CIwL9IBJ5i1UXk,20070
|
10
|
+
reywechat/rtrigger.py,sha256=gDnokfFjw29Kz9qazxtb2clT2pBsuOJqIEErvg7L3hE,4986
|
11
|
+
reywechat/rwechat.py,sha256=i8y-4kl7XRw-auVGy8JJ0Ci55Th7FWCiyK3ZzFOb3xg,4748
|
12
|
+
reywechat/data/client_api.dll,sha256=H9uj-x9Ztg0jFZK0yY6NsnyH5_119dQRFfoVVMidxRs,592384
|
13
|
+
reywechat-1.0.80.dist-info/METADATA,sha256=89D7CPi82CvgSx5XE4ejxjEupz6tzz4JuPNWOksofxk,1551
|
14
|
+
reywechat-1.0.80.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
+
reywechat-1.0.80.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
16
|
+
reywechat-1.0.80.dist-info/RECORD,,
|
@@ -1,16 +0,0 @@
|
|
1
|
-
reywechat/__init__.py,sha256=FXc3XSiPLLmz9bgZdiYKxeWX-7VT9RqPc_EkXp3Kk0I,476
|
2
|
-
reywechat/rall.py,sha256=5J_X-XMOyb1Vp1jyS9-oRFXGOtp2vRPX1g3tJot_Eck,371
|
3
|
-
reywechat/rbase.py,sha256=hbxn5spvcl_C_Bw8A9teulOXT9GMlxUw145_YbXIOzc,1124
|
4
|
-
reywechat/rcache.py,sha256=5FIa8UB3VsLHT_EXHHmFP62a5AeS22anJCJXC8t4tWw,908
|
5
|
-
reywechat/rclient.py,sha256=ayOtQ0CaF8ydXjirLdVed8FbpfdQVTKVSd0x4grs-pQ,22712
|
6
|
-
reywechat/rdb.py,sha256=pu_8i_e0RRmyD6Oc1lHvgomipCyt5bfpMZQDA-7u9yQ,50804
|
7
|
-
reywechat/rlog.py,sha256=TSA-_5pwlq0sUND2cnLDqXvdmAdMAkC7tXIz3WfJ7Xw,5259
|
8
|
-
reywechat/rreceive.py,sha256=YPMW99BDfgdv-6LdWE0C1NNQdh_FWVclcMMMioe74lo,50972
|
9
|
-
reywechat/rsend.py,sha256=MUpLeVeKc-9zswARqB3WLDmaOPLpAtN_u4788MHWoC8,20079
|
10
|
-
reywechat/rtrigger.py,sha256=c0peI208K2k2sOxtuszD8UMrhMrTGp0LMi_XE5ksJKg,4989
|
11
|
-
reywechat/rwechat.py,sha256=g0pbprMPv_qWb_lGFrPDAWsJO4vPSIgFLkw0Y28CZUo,4751
|
12
|
-
reywechat/data/client_api.dll,sha256=H9uj-x9Ztg0jFZK0yY6NsnyH5_119dQRFfoVVMidxRs,592384
|
13
|
-
reywechat-1.0.78.dist-info/METADATA,sha256=1EAY_ivFfmAkobkWeV9iPZY_rH1DjSp5GHxCnHsK3iM,1551
|
14
|
-
reywechat-1.0.78.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
-
reywechat-1.0.78.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
16
|
-
reywechat-1.0.78.dist-info/RECORD,,
|
File without changes
|
File without changes
|