reywechat 1.0.43__py3-none-any.whl → 1.0.45__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/rreceive.py CHANGED
@@ -18,6 +18,7 @@ from bs4 import BeautifulSoup as BSBeautifulSoup
18
18
  from bs4.element import Tag as BSTag
19
19
  from reykit.rbase import throw
20
20
  from reykit.rimage import decode_qrcode
21
+ from reykit.rlog import Mark
21
22
  from reykit.rnet import listen_socket
22
23
  from reykit.ros import File, os_exists
23
24
  from reykit.rre import search, search_batch, findall
@@ -499,7 +500,7 @@ class WeChatMessage(BaseWeChat):
499
500
  result: str | None = search(pattern, text)
500
501
  if result is not None:
501
502
  is_call_name = True
502
- text = result
503
+ text = result or None
503
504
  else:
504
505
  is_call_name = False
505
506
 
@@ -521,10 +522,29 @@ class WeChatMessage(BaseWeChat):
521
522
  ):
522
523
  is_call = True
523
524
  call_text = text
525
+
526
+ ## Call next.
527
+ elif (
528
+ self.room is not None
529
+ and (value := f'{self.room}_{self.user}') in self.receiver.call_next_mark
530
+ ):
531
+ self.receiver.call_next_mark.remove(value)
532
+ is_call = True
533
+ call_text = text
534
+
524
535
  else:
525
536
  is_call = False
526
537
  call_text = None
527
538
 
539
+ # Call next.
540
+ if (
541
+ is_call
542
+ and call_text is None
543
+ and self.room is not None
544
+ ):
545
+ value = f'{self.room}_{self.user}'
546
+ self.receiver.call_next_mark(value)
547
+
528
548
  self._is_call = is_call
529
549
  self._call_text = call_text
530
550
 
@@ -1064,6 +1084,7 @@ class WechatReceiver(BaseWeChat):
1064
1084
  self.queue: Queue[WeChatMessage] = Queue()
1065
1085
  self.handlers: list[Callable[[WeChatMessage], Any]] = []
1066
1086
  self.started: bool | None = False
1087
+ self.call_next_mark = Mark()
1067
1088
  self.trigger = WeChatTrigger(self)
1068
1089
 
1069
1090
  # Start.
reywechat/rsend.py CHANGED
@@ -17,7 +17,6 @@ from functools import wraps as functools_wraps
17
17
  from queue import Queue
18
18
  from re import escape as re_escape
19
19
  from reykit.rbase import throw, catch_exc
20
- from reykit.ros import File
21
20
  from reykit.rre import sub
22
21
  from reykit.rtime import sleep
23
22
  from reykit.rwrap import wrap_thread, wrap_exc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reywechat
3
- Version: 1.0.43
3
+ Version: 1.0.45
4
4
  Summary: WeChat method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reywechat/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -5,13 +5,13 @@ reywechat/rcache.py,sha256=Hh_HE-t_KUMlrz4gEFPh1AjmhnrSgH520IFJPumWb7A,908
5
5
  reywechat/rclient.py,sha256=MEvQB3pHb5ORukKbKntalRtFcKIOP9BGtDsMt5ihQfM,22524
6
6
  reywechat/rdb.py,sha256=akIQsx4CZIt-H6kXWn2vpUYjo5MgD8MluzBMnSdmLaM,40051
7
7
  reywechat/rlog.py,sha256=IJL2WquiOYfB9iEai9xjojkuxPxiRHkdzZ5vCeaSA98,5261
8
- reywechat/rreceive.py,sha256=40l3n_d1BcT2EhxIYOlOnzrSQkJ8WDI_qPvJcU7CSQU,35018
8
+ reywechat/rreceive.py,sha256=KviaL3yODlCxc7muCoosk5N0V5_aJYEGQQJNZeOvbYI,35627
9
9
  reywechat/rschedule.py,sha256=X9kreXdClTeItJHmNPJNqb_lct-BiLCyusMQxsj5hWU,1865
10
- reywechat/rsend.py,sha256=iRxC7iURbF4UHbNkG2ITT1YUOCpAZ4amjeEkBQY1Bos,17624
10
+ reywechat/rsend.py,sha256=GfCv5O1-81r-o-RLzMMW_MQE99KwO9gZ3-93HaJ97W8,17595
11
11
  reywechat/rtrigger.py,sha256=n8kUNovh62r7crlXrp33uaKvbILT-wcfvUqeyGt7YhM,4956
12
12
  reywechat/rwechat.py,sha256=OcElINAi9jM-eDb_OTtseBW3kyG_3jD4V4QmltR6MeE,4874
13
13
  reywechat/data/client_api.dll,sha256=H9uj-x9Ztg0jFZK0yY6NsnyH5_119dQRFfoVVMidxRs,592384
14
- reywechat-1.0.43.dist-info/METADATA,sha256=vhJ7vHjnzo4fsufh05pCzdS3NCkw7P122ad3_JnOD70,1551
15
- reywechat-1.0.43.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
- reywechat-1.0.43.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
17
- reywechat-1.0.43.dist-info/RECORD,,
14
+ reywechat-1.0.45.dist-info/METADATA,sha256=yLokP8GcJTizmArK9zQ7n30AZ_2f2L6gffRnxa0x2aY,1551
15
+ reywechat-1.0.45.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
+ reywechat-1.0.45.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
17
+ reywechat-1.0.45.dist-info/RECORD,,