hyper-bot 0.80.2__tar.gz → 0.80.5__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.
Files changed (46) hide show
  1. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/PKG-INFO +1 -1
  2. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyper_bot.egg-info/PKG-INFO +1 -1
  3. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/OneBot.py +30 -1
  4. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/__init__.py +1 -1
  5. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/events.py +1 -0
  6. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/segments.py +7 -1
  7. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/utils/apiresponse.py +2 -3
  8. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/LICENSE +0 -0
  9. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyper_bot.egg-info/SOURCES.txt +0 -0
  10. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyper_bot.egg-info/dependency_links.txt +0 -0
  11. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyper_bot.egg-info/requires.txt +0 -0
  12. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyper_bot.egg-info/top_level.txt +0 -0
  13. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/Kritor.py +0 -0
  14. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/Manager.py +0 -0
  15. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/Res.py +0 -0
  16. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/__init__.py +0 -0
  17. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/authentication/__init__.py +0 -0
  18. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/common/__init__.py +0 -0
  19. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/core/__init__.py +0 -0
  20. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/customization/__init__.py +0 -0
  21. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/developer/__init__.py +0 -0
  22. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/event/__init__.py +0 -0
  23. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/file/__init__.py +0 -0
  24. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/friend/__init__.py +0 -0
  25. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/group/__init__.py +0 -0
  26. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/guild/__init__.py +0 -0
  27. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/message/__init__.py +0 -0
  28. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/process/__init__.py +0 -0
  29. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/reverse/__init__.py +0 -0
  30. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/KritorLib/protos/web/__init__.py +0 -0
  31. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/OneBotLib/Manager.py +0 -0
  32. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/Adapters/OneBotLib/Res.py +0 -0
  33. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/common.py +0 -0
  34. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/configurator.py +0 -0
  35. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/hyperogger.py +0 -0
  36. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/listener.py +0 -0
  37. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/network.py +0 -0
  38. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/service.py +0 -0
  39. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/utils/ArkSignHelper.py +0 -0
  40. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/utils/errors.py +0 -0
  41. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/utils/hypetyping.py +0 -0
  42. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/utils/logic.py +0 -0
  43. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/utils/screens.py +0 -0
  44. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/hyperot/utils/typextensions.py +0 -0
  45. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/setup.cfg +0 -0
  46. {hyper_bot-0.80.2 → hyper_bot-0.80.5}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hyper-bot
3
- Version: 0.80.2
3
+ Version: 0.80.5
4
4
  Summary: 稳定高效、易于开发的QQ Bot框架
5
5
  Home-page: https://github.com/HarcicYang/HypeR_Bot
6
6
  Author: Harcic
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hyper-bot
3
- Version: 0.80.2
3
+ Version: 0.80.5
4
4
  Summary: 稳定高效、易于开发的QQ Bot框架
5
5
  Home-page: https://github.com/HarcicYang/HypeR_Bot
6
6
  Author: Harcic
@@ -105,6 +105,26 @@ class Actions:
105
105
  packet.send_to(self.connection)
106
106
  return common.Ret.fetch(packet.echo, SendForwardRsp)
107
107
 
108
+ async def get_forward_msg(self, sid: str) -> common.Ret[common.Message]:
109
+ packet = common.Packet(
110
+ "get_forward_msg",
111
+ id=sid,
112
+ )
113
+ packet.send_to(self.connection)
114
+ ret = common.Ret.fetch(packet.echo, events.gen_message)
115
+ for i in ret.data:
116
+ if isinstance(i, segments.Node):
117
+ i.content = gen_message({"message": i.content})
118
+
119
+ return ret
120
+
121
+ async def forward_solve(self, message: common.Message) -> common.Message:
122
+ for i in message:
123
+ if isinstance(i, segments.Forward):
124
+ data = await self.get_forward_msg(i.id)
125
+ return data.data
126
+ raise ValueError("Incorrect message type")
127
+
108
128
  async def send_group_forward_msg(self, group_id: int, message: common.Message) -> common.Ret[SendGrpForwardRsp]:
109
129
  packet = common.Packet(
110
130
  "send_group_forward_msg",
@@ -114,7 +134,8 @@ class Actions:
114
134
  packet.send_to(self.connection)
115
135
  return common.Ret.fetch(packet.echo, SendForwardRsp)
116
136
 
117
- async def set_group_add_request(self, flag: str, sub_type: str, approve: bool, reason: str = "Not Mentioned") -> None:
137
+ async def set_group_add_request(self, flag: str, sub_type: str, approve: bool,
138
+ reason: str = "Not Mentioned") -> None:
118
139
  common.Packet(
119
140
  "set_group_add_request",
120
141
  flag=flag,
@@ -179,6 +200,14 @@ class Actions:
179
200
  packet.send_to(self.connection)
180
201
  return common.Ret.fetch(packet.echo, GetMsgRsp)
181
202
 
203
+ async def send_callback(self, group_id: int, bot_id: int, data: dict) -> None:
204
+ common.Packet(
205
+ "send_group_bot_callback",
206
+ group_id=group_id,
207
+ bot_id=bot_id,
208
+ **data
209
+ ).send_to(self.connection)
210
+
182
211
 
183
212
  async def tester(
184
213
  message_data: Union[Event, HyperNotify], actions: Actions
@@ -7,7 +7,7 @@ import importlib
7
7
  import sys
8
8
  import os
9
9
 
10
- HYPER_BOT_VERSION = "0.80.2"
10
+ HYPER_BOT_VERSION = "0.80.5"
11
11
 
12
12
  listener: "Listener"
13
13
 
@@ -36,6 +36,7 @@ class EventManager:
36
36
  return wrapper
37
37
 
38
38
  def new(self, data: dict) -> "Event":
39
+ logger.trace(str(data))
39
40
  try:
40
41
  return self.event_lis[data["post_type"]][data[f"{data['post_type']}_type"]](data)
41
42
  except KeyError:
@@ -4,6 +4,7 @@ import typing
4
4
  import uuid
5
5
 
6
6
  from .utils.errors import *
7
+ from .utils.hypetyping import Union
7
8
  from . import configurator
8
9
 
9
10
  config = configurator.BotConfig.get("hyper-bot")
@@ -47,6 +48,9 @@ class Text(SegmentBase, st="text", su="<text>"):
47
48
  text: str
48
49
 
49
50
 
51
+ class StreamTest(SegmentBase, st="stream", su="[Stream] <text>"):
52
+ text: str
53
+
50
54
  class Image(MediaSeg, st="image", su="[Image]"):
51
55
  file: str
52
56
  url: str
@@ -99,7 +103,9 @@ class Forward(SegmentBase, st="forward", su="[Forward]"):
99
103
 
100
104
 
101
105
  class Node(SegmentBase, st="node", su="[Node]"):
102
- id: str
106
+ user_id: str
107
+ nickname: str
108
+ content: Union[dict, "common.Message"]
103
109
 
104
110
 
105
111
  class CustomNode:
@@ -185,7 +185,8 @@ class GetMsgRsp(BaseResponse):
185
185
 
186
186
  @classmethod
187
187
  def build(
188
- cls, time: int, message_type: Literal["private", "group"], message_id: int, real_id: int, sender: dict, message: dict
188
+ cls, time: int, message_type: Literal["private", "group"], message_id: int, real_id: int, sender: dict,
189
+ message: dict
189
190
  ):
190
191
  return cls(
191
192
  {
@@ -197,5 +198,3 @@ class GetMsgRsp(BaseResponse):
197
198
  "message": message
198
199
  }
199
200
  )
200
-
201
-
File without changes
File without changes
File without changes
File without changes