OneBotConnecter 0.4.1__tar.gz → 0.4.2__tar.gz

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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OneBotConnecter
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: 基于websocket(服务器正向)连接的onebot11通用python接口
5
5
  Author-email: Sugar51243 <1733682365@qq.com>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "OneBotConnecter"
7
- version = "0.4.01"
7
+ version = "0.4.02"
8
8
  authors = [
9
9
  { name="Sugar51243", email="1733682365@qq.com" },
10
10
  ]
@@ -265,40 +265,26 @@ class PrivateCardMessage(Message):
265
265
  class ForwardMessage(Message):
266
266
 
267
267
  data: list[Message]
268
+ user_id: str
269
+ nickname: str
268
270
 
269
271
  def __init__(self, data: list[Message] | Message, user_id: str, nickname: str = "某人"):
270
272
  if not isinstance(data, list):
271
273
  data = [data]
272
- self.data = [{
273
- "type": "node",
274
- "user_id": user_id,
275
- "nickname": nickname,
276
- "data": {
277
- "content": [msg.to_dict() for msg in data]
278
- }
279
- }]
274
+ self.data = data
280
275
  self.user_id = user_id
281
276
  self.nickname = nickname
282
277
 
283
278
  def to_dict(self):
284
279
  msg = {
285
- "type": "forward",
286
- "messages": self.data
287
- }
288
- return msg
289
-
290
- def addNode(self, data: list[Message] | Message, user_id: str, nickname: str = "某人"):
291
- if not isinstance(data, list):
292
- data = [data]
293
- node = {
294
280
  "type": "node",
295
- "user_id": user_id,
296
- "nickname": nickname,
281
+ "user_id": self.user_id,
282
+ "nickname": self.nickname,
297
283
  "data": {
298
- "content": [msg.to_dict() for msg in data]
284
+ "content": [msg.to_dict() for msg in self.data]
299
285
  }
300
286
  }
301
- self.data.append(node)
287
+ return msg
302
288
 
303
289
  def returnData(self):
304
290
  return [self.to_dict()]
@@ -345,7 +331,7 @@ class MessageChain(Message):
345
331
  self.data.extend(message.returnData())
346
332
 
347
333
  def to_dict(self):
348
- return {}
334
+ return self.data
349
335
 
350
336
  def returnData(self):
351
337
  return self.data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OneBotConnecter
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: 基于websocket(服务器正向)连接的onebot11通用python接口
5
5
  Author-email: Sugar51243 <1733682365@qq.com>
6
6
  License: MIT License
File without changes