AstrBot 4.12.0__py3-none-any.whl → 4.12.1__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.
- astrbot/cli/__init__.py +1 -1
- astrbot/core/config/default.py +1 -1
- astrbot/core/platform/astr_message_event.py +23 -4
- {astrbot-4.12.0.dist-info → astrbot-4.12.1.dist-info}/METADATA +1 -1
- {astrbot-4.12.0.dist-info → astrbot-4.12.1.dist-info}/RECORD +8 -8
- {astrbot-4.12.0.dist-info → astrbot-4.12.1.dist-info}/WHEEL +0 -0
- {astrbot-4.12.0.dist-info → astrbot-4.12.1.dist-info}/entry_points.txt +0 -0
- {astrbot-4.12.0.dist-info → astrbot-4.12.1.dist-info}/licenses/LICENSE +0 -0
astrbot/cli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "4.12.
|
|
1
|
+
__version__ = "4.12.1"
|
astrbot/core/config/default.py
CHANGED
|
@@ -42,8 +42,6 @@ class AstrMessageEvent(abc.ABC):
|
|
|
42
42
|
"""消息对象, AstrBotMessage。带有完整的消息结构。"""
|
|
43
43
|
self.platform_meta = platform_meta
|
|
44
44
|
"""消息平台的信息, 其中 name 是平台的类型,如 aiocqhttp"""
|
|
45
|
-
self.session_id = session_id
|
|
46
|
-
"""用户的会话 ID。可以直接使用下面的 unified_msg_origin"""
|
|
47
45
|
self.role = "member"
|
|
48
46
|
"""用户是否是管理员。如果是管理员,这里是 admin"""
|
|
49
47
|
self.is_wake = False
|
|
@@ -51,12 +49,12 @@ class AstrMessageEvent(abc.ABC):
|
|
|
51
49
|
self.is_at_or_wake_command = False
|
|
52
50
|
"""是否是 At 机器人或者带有唤醒词或者是私聊(插件注册的事件监听器会让 is_wake 设为 True, 但是不会让这个属性置为 True)"""
|
|
53
51
|
self._extras: dict[str, Any] = {}
|
|
54
|
-
self.session =
|
|
52
|
+
self.session = MessageSession(
|
|
55
53
|
platform_name=platform_meta.id,
|
|
56
54
|
message_type=message_obj.type,
|
|
57
55
|
session_id=session_id,
|
|
58
56
|
)
|
|
59
|
-
self.unified_msg_origin = str(self.session)
|
|
57
|
+
# self.unified_msg_origin = str(self.session)
|
|
60
58
|
"""统一的消息来源字符串。格式为 platform_name:message_type:session_id"""
|
|
61
59
|
self._result: MessageEventResult | None = None
|
|
62
60
|
"""消息事件的结果"""
|
|
@@ -72,6 +70,27 @@ class AstrMessageEvent(abc.ABC):
|
|
|
72
70
|
# back_compability
|
|
73
71
|
self.platform = platform_meta
|
|
74
72
|
|
|
73
|
+
@property
|
|
74
|
+
def unified_msg_origin(self) -> str:
|
|
75
|
+
"""统一的消息来源字符串。格式为 platform_name:message_type:session_id"""
|
|
76
|
+
return str(self.session)
|
|
77
|
+
|
|
78
|
+
@unified_msg_origin.setter
|
|
79
|
+
def unified_msg_origin(self, value: str):
|
|
80
|
+
"""设置统一的消息来源字符串。格式为 platform_name:message_type:session_id"""
|
|
81
|
+
self.new_session = MessageSession.from_str(value)
|
|
82
|
+
self.session = self.new_session
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def session_id(self) -> str:
|
|
86
|
+
"""用户的会话 ID。可以直接使用下面的 unified_msg_origin"""
|
|
87
|
+
return self.session.session_id
|
|
88
|
+
|
|
89
|
+
@session_id.setter
|
|
90
|
+
def session_id(self, value: str):
|
|
91
|
+
"""设置用户的会话 ID。可以直接使用下面的 unified_msg_origin"""
|
|
92
|
+
self.session.session_id = value
|
|
93
|
+
|
|
75
94
|
def get_platform_name(self):
|
|
76
95
|
"""获取这个事件所属的平台的类型(如 aiocqhttp, slack, discord 等)。
|
|
77
96
|
|
|
@@ -38,7 +38,7 @@ astrbot/builtin_stars/web_searcher/metadata.yaml,sha256=aHAKtP8UZJaddzIN2eFfglTO
|
|
|
38
38
|
astrbot/builtin_stars/web_searcher/engines/__init__.py,sha256=yQtZwF4E19yVcyRIOLP9KEgnADXjeQd-AmCtVZtvjBs,4269
|
|
39
39
|
astrbot/builtin_stars/web_searcher/engines/bing.py,sha256=pn3DPR-5SO2D_RtBIU3l9Ph7PTUB-FCZAMCYuk6kd6Q,1035
|
|
40
40
|
astrbot/builtin_stars/web_searcher/engines/sogo.py,sha256=YA7pA5-335r7UgKpyUPAeGGZQbYEwDBO8bm08Ro8Xg0,1701
|
|
41
|
-
astrbot/cli/__init__.py,sha256=
|
|
41
|
+
astrbot/cli/__init__.py,sha256=efRvSxKz8ThqjhlDQIocXuZHCUs9lwFdpphvCh1ArIk,23
|
|
42
42
|
astrbot/cli/__main__.py,sha256=QobgMyFoLNTgI_OYddhGOZ9ZvQeBVjjz79mA2cC2OEU,1758
|
|
43
43
|
astrbot/cli/commands/__init__.py,sha256=eAgppZQIqFO1ylQJFABeYrzQ0oZqPWjtE80aKIPB3ks,149
|
|
44
44
|
astrbot/cli/commands/cmd_conf.py,sha256=6-YLicBt_zjWTzaVLUJ1VQLQPbDEPYACB9IVnN8Zvng,6330
|
|
@@ -95,7 +95,7 @@ astrbot/core/backup/exporter.py,sha256=tULFmXhYqRhJtAwePFkxXMSKqct1MSMyISv9LrfKw
|
|
|
95
95
|
astrbot/core/backup/importer.py,sha256=efGW5-5ZAfvN1mg4rcc5OrcFTLfyj7L9T0Yd7SBUlNo,28618
|
|
96
96
|
astrbot/core/config/__init__.py,sha256=vZjtpC7vr-IvBgSUtbS04C0wpulmCG5tPmcEP1WYE_4,172
|
|
97
97
|
astrbot/core/config/astrbot_config.py,sha256=5r2VhCNO4VuGCqct12g10-TcvAKyXV40-suk5vRMGns,6436
|
|
98
|
-
astrbot/core/config/default.py,sha256=
|
|
98
|
+
astrbot/core/config/default.py,sha256=eggahfRJ749EzTJzYuClFNZFW8oV4uwWHwfYeGPxzlc,157051
|
|
99
99
|
astrbot/core/config/i18n_utils.py,sha256=HJn_0XeeVS9ryCBelYfnc0nEn10LlX702fcSSFrF1J8,3879
|
|
100
100
|
astrbot/core/db/__init__.py,sha256=EQor28zGVxAECY30i9NDoeuPOo9inimpF5JV3E0N1BE,15608
|
|
101
101
|
astrbot/core/db/po.py,sha256=7V8xZTDOojrhd4ULtREmraFZtW976mg7iHbfbVKgKEI,14287
|
|
@@ -160,7 +160,7 @@ astrbot/core/pipeline/session_status_check/stage.py,sha256=448eWo72O-JZCXMGBLznJ
|
|
|
160
160
|
astrbot/core/pipeline/waking_check/stage.py,sha256=umd9eAp3E5gALRbfl2S-BtcQcMQfUfadfp4jXVxwix4,9844
|
|
161
161
|
astrbot/core/pipeline/whitelist_check/stage.py,sha256=x6o4oswIvVtHFRbuKuLFoyFEgx-gSo3IMGYvopu8d9A,2411
|
|
162
162
|
astrbot/core/platform/__init__.py,sha256=5Hhb2mIb8mS2RWfxILIMuV03XiyfqEbn4pAjvi8ntl0,361
|
|
163
|
-
astrbot/core/platform/astr_message_event.py,sha256=
|
|
163
|
+
astrbot/core/platform/astr_message_event.py,sha256=gyTq5eBYXt7eU3S3di0EYlCbUcv40XzbxEL3-kD1-Z8,15450
|
|
164
164
|
astrbot/core/platform/astrbot_message.py,sha256=kdoiyZoCaH3iVua4pvKw7HHlfVpVB4bI36UeqYX1o38,2670
|
|
165
165
|
astrbot/core/platform/manager.py,sha256=iz6mnYE6DAIZ_b_bkqWfTNYCffRKJVHqsbxuugM3pTU,11549
|
|
166
166
|
astrbot/core/platform/message_session.py,sha256=Fg0MWI4i6IB2jsD39a7fAduFtNcVdFIi40HAHeR9brk,1092
|
|
@@ -327,8 +327,8 @@ astrbot/dashboard/routes/static_file.py,sha256=7KnNcOb1BVqSTft114LhGsDkfg69X2jHE
|
|
|
327
327
|
astrbot/dashboard/routes/t2i.py,sha256=F6smxdL99MF7cRw3hqS6-2GErw8Zhsv0V0mfBUeEk-c,8931
|
|
328
328
|
astrbot/dashboard/routes/tools.py,sha256=mMwVFw_VOlpqy_WZg1A-ddGtYa5L5QLWYawl37PT0-c,15354
|
|
329
329
|
astrbot/dashboard/routes/update.py,sha256=qXiqQ_dbqRVftOzGgCQrvK8-qopVK6zKhhVVJ9SK26U,6648
|
|
330
|
-
astrbot-4.12.
|
|
331
|
-
astrbot-4.12.
|
|
332
|
-
astrbot-4.12.
|
|
333
|
-
astrbot-4.12.
|
|
334
|
-
astrbot-4.12.
|
|
330
|
+
astrbot-4.12.1.dist-info/METADATA,sha256=ACRs6md1esRbF78tYedI5s2Apc4sPBkLQBFeg9T-tLo,11915
|
|
331
|
+
astrbot-4.12.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
332
|
+
astrbot-4.12.1.dist-info/entry_points.txt,sha256=OEF09YmhBWYuViXrvTLLpstF4ccmNwDL8r7nnFD0pfI,53
|
|
333
|
+
astrbot-4.12.1.dist-info/licenses/LICENSE,sha256=zPfQj5Mq8-gThIiBcxETr7t8gND9bZWOjTGQAr80TQI,34500
|
|
334
|
+
astrbot-4.12.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|