b-botpy 1.0.0__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.
@@ -0,0 +1,183 @@
1
+ Metadata-Version: 2.4
2
+ Name: b-botpy
3
+ Version: 1.0.0
4
+ Summary: qq robot client with python3
5
+ Home-page: https://github.com/jdnjk/botpy
6
+ Author: jdnjk
7
+ License: Tencent
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Software Development
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3.7
13
+ License-File: LICENSE
14
+ Requires-Dist: aiohttp<4,>=3.7.4
15
+ Requires-Dist: PyYAML
16
+ Requires-Dist: APScheduler
17
+ Dynamic: author
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: home-page
21
+ Dynamic: license
22
+ Dynamic: license-file
23
+ Dynamic: requires-dist
24
+ Dynamic: summary
25
+
26
+ .. role:: raw-html-m2r(raw)
27
+ :format: html
28
+
29
+
30
+ botpy
31
+ =====
32
+
33
+ **botpy** 是基于\ `机器人开放平台API <https://bot.q.qq.com/wiki/develop/api/>`_ 实现的机器人框架,目的提供一个易使用、开发效率高的开发框架。
34
+
35
+
36
+ .. image:: https://img.shields.io/pypi/v/qq-botpy
37
+ :target: https://img.shields.io/pypi/v/qq-botpy
38
+ :alt: PyPI
39
+
40
+
41
+ .. image:: https://api.bkdevops.qq.com/process/api/external/pipelines/projects/qq-guild-open/p-713959939bdc4adca0eea2d4420eef4b/badge?X-DEVOPS-PROJECT-ID=qq-guild-open
42
+ :target: https://devops.woa.com/process/api-html/user/builds/projects/qq-guild-open/pipelines/p-713959939bdc4adca0eea2d4420eef4b/latestFinished?X-DEVOPS-PROJECT-ID=qq-guild-open
43
+ :alt: BK Pipelines Status
44
+
45
+
46
+ 准备工作
47
+ --------
48
+
49
+ 安装
50
+ ^^^^
51
+
52
+ .. code-block:: bash
53
+
54
+ pip install qq-botpy
55
+
56
+ 更新包的话需要添加 ``--upgrade`` ``注:需要python3.7+``
57
+
58
+ 使用
59
+ ^^^^
60
+
61
+ 需要使用的地方\ ``import botpy``
62
+
63
+ .. code-block:: python
64
+
65
+ import botpy
66
+
67
+ 兼容提示
68
+ ^^^^^^^^
69
+
70
+ ..
71
+
72
+ 原机器人的老版本\ ``qq-bot``\ 仍然可以使用,但新接口的支持上会逐渐暂停,此次升级不会影响线上使用的机器人
73
+
74
+
75
+ 使用方式
76
+ --------
77
+
78
+ 快速入门
79
+ ^^^^^^^^
80
+
81
+ 步骤1
82
+ ~~~~~
83
+
84
+ 通过继承实现\ ``bot.Client``\ , 实现自己的机器人Client
85
+
86
+ 步骤2
87
+ ~~~~~
88
+
89
+ 实现机器人相关事件的处理方法,如 ``on_at_message_create``\ , 详细的事件监听列表,请参考 `事件监听.md <./docs/事件监听.md>`_
90
+
91
+ 如下,是定义机器人被@的后自动回复:
92
+
93
+ .. code-block:: python
94
+
95
+ import botpy
96
+ from botpy.types.message import Message
97
+
98
+ class MyClient(botpy.Client):
99
+ async def on_ready(self):
100
+ print(f"robot 「{self.robot.name}」 on_ready!")
101
+
102
+ async def on_at_message_create(self, message: Message):
103
+ await message.reply(content=f"机器人{self.robot.name}收到你的@消息了: {message.content}")
104
+
105
+ ``注意:每个事件会下发具体的数据对象,如`message`相关事件是`message.Message`的对象 (部分事件透传了后台数据,暂未实现对象缓存)``
106
+
107
+ 步骤3
108
+ ~~~~~
109
+
110
+ 设置机器人需要监听的事件通道,并启动\ ``client``
111
+
112
+ .. code-block:: python
113
+
114
+ import botpy
115
+ from botpy.types.message import Message
116
+
117
+ class MyClient(botpy.Client):
118
+ async def on_at_message_create(self, message: Message):
119
+ await self.api.post_message(channel_id=message.channel_id, content="content")
120
+
121
+ intents = botpy.Intents(public_guild_messages=True)
122
+ client = MyClient(intents=intents)
123
+ client.run(appid="12345", token="xxxx")
124
+
125
+ 备注
126
+ ^^^^
127
+
128
+ 也可以通过预设置的类型,设置需要监听的事件通道
129
+
130
+ .. code-block:: python
131
+
132
+ import botpy
133
+
134
+ intents = botpy.Intents.none()
135
+ intents.public_guild_messages=True
136
+
137
+ 使用API
138
+ ^^^^^^^
139
+
140
+ 如果要使用\ ``api``\ 方法,可以参考如下方式:
141
+
142
+ .. code-block:: python
143
+
144
+ import botpy
145
+ from botpy.types.message import Message
146
+
147
+ class MyClient(botpy.Client):
148
+ async def on_at_message_create(self, message: Message):
149
+ await self.api.post_message(channel_id=message.channel_id, content="content")
150
+
151
+ 示例机器人
152
+ ----------
153
+
154
+ `\ ``examples`` <./examples/>`_ 目录下存放示例机器人,具体使用可参考\ `\ ``Readme.md`` <./examples/README.md>`_
155
+
156
+ .. code-block::
157
+
158
+ examples/
159
+ .
160
+ ├── README.md
161
+ ├── config.example.yaml # 示例配置文件(需要修改为config.yaml)
162
+ ├── demo_announce.py # 机器人公告API使用示例
163
+ ├── demo_api_permission.py # 机器人授权查询API使用示例
164
+ ├── demo_at_reply.py # 机器人at被动回复async示例
165
+ ├── demo_at_reply_ark.py # 机器人at被动回复ark消息示例
166
+ ├── demo_at_reply_embed.py # 机器人at被动回复embed消息示例
167
+ ├── demo_at_reply_command.py # 机器人at被动使用Command指令装饰器回复消息示例
168
+ ├── demo_at_reply_file_data.py # 机器人at被动回复本地图片消息示例
169
+ ├── demo_at_reply_keyboard.py # 机器人at被动回复md带内嵌键盘的示例
170
+ ├── demo_at_reply_markdown.py # 机器人at被动回复md消息示例
171
+ ├── demo_at_reply_reference.py # 机器人at被动回复消息引用示例
172
+ ├── demo_dms_reply.py # 机器人私信被动回复示例
173
+ ├── demo_get_reaction_users.py # 机器人获取表情表态成员列表示例
174
+ ├── demo_guild_member_event.py # 机器人频道成员变化事件示例
175
+ ├── demo_interaction.py # 机器人互动事件示例(未启用)
176
+ ├── demo_pins_message.py # 机器人消息置顶示例
177
+ ├── demo_recall.py # 机器人消息撤回示例
178
+ ├── demo_schedule.py # 机器人日程相关示例
179
+
180
+ 更多功能
181
+ --------
182
+ 更多功能请参考: [https://github.com/tencent-connect/botpy]
183
+
@@ -0,0 +1,49 @@
1
+ b_botpy-1.0.0.dist-info/licenses/LICENSE,sha256=MhWInLjQupPN-FhF586nF1L_RdhPN6r1ypA4Go63RN8,1064
2
+ botpy/__init__.py,sha256=iAURHfsXbZz7hfqVi0AhZR1_tg3aNX7Y-hzxzrxcuJQ,122
3
+ botpy/api.py,sha256=Lwe6gzxgpqYQw7MMJks5lku_Zl5-Wldh3hD86uqDk9g,56124
4
+ botpy/audio.py,sha256=5WkwQrkYHU4dP3wzEdKDslV-WYyC8qbH5I_COJiOaP0,1275
5
+ botpy/channel.py,sha256=dgE-REnL9m0cc0jrAD6RrHHnvBHA7FLdUbhd_3GYNOs,1152
6
+ botpy/client.py,sha256=3msPFUm0GtXjBB7azjNO9Iv8CJfVvvOealw0sxme6bo,10240
7
+ botpy/connection.py,sha256=PmGZCYfGWdNKnZkEpnoZnn7uH5G3u0ibgxrsmuFE-e0,13739
8
+ botpy/errors.py,sha256=CC5mqczSr4WalOdhQSNsmh8m7O1RVMNtwYZmDYKLhek,1096
9
+ botpy/flags.py,sha256=-8JPv60vLfT37YqlQU52w3I9nXfCX5OFFamzVl0SBK0,12825
10
+ botpy/forum.py,sha256=tku5LYN0RJC3aRALn9iG7oirb0McGzRAbf4guJ_ZI7c,5373
11
+ botpy/gateway.py,sha256=qccGY0BnNkoulVqViVbyPZKKdPeGduEnUWJHkkhb_js,8605
12
+ botpy/guild.py,sha256=3CcK0OceqgDb88iXZ6E1f13USWDRZ7okX12dAgnY2rA,1035
13
+ botpy/http.py,sha256=3CyuM03RtQ9kB5sEDGYgRmurXVBWCYobiRnId0s1yd8,7817
14
+ botpy/interaction.py,sha256=h42KpvpXt4bv2NbBC-C-rjyuEhe18VVItGCc48dzNc8,2052
15
+ botpy/logging.py,sha256=P2H4qFik45UsiQXifS3lyd_X6EaCEIIdICVu0cs2Ifo,5081
16
+ botpy/manage.py,sha256=E_MUFe9CliEH-VcG5-H1kNt2c4iKuz7Vw65K9tDlaSo,1203
17
+ botpy/message.py,sha256=EWf0YbrJN-sPZl7ZKNYBllpDdL4OEn3bO_HXAt-Trj8,9894
18
+ botpy/reaction.py,sha256=nNr106eE2GPfZWMqsygzpe2RaXq7dzWwGh2mW3XAwTA,1239
19
+ botpy/robot.py,sha256=Wdk8Ed4BBbjapEorLBrS2FNVx5vtnxNExCbQ8ARhT7g,2370
20
+ botpy/user.py,sha256=5BFbmEecrVK1JL88jr9Ovi4GJu0XP7vm2RrNsYkm86I,1137
21
+ botpy/ext/__init__.py,sha256=anH_bTMgRkjIUyHFjEq8qLFMNUg4m9IIrhVlz_od-eU,85
22
+ botpy/ext/command_util.py,sha256=mW-12e8AJhhH3IRgc6hk5Wr_kKiXn7by41j5WapUzu0,775
23
+ botpy/ext/channel_jump/__init__.py,sha256=RLkaCibD_NmJy6i-QJKxkvIBXxOY-ceCyseamDBijbI,2240
24
+ botpy/ext/cog_apscheduler/__init__.py,sha256=y-ZPZ6D66Jh3f83dxWL9uYvoVl_ZTBiMmumn_WUh8bo,308
25
+ botpy/ext/cog_yaml/__init__.py,sha256=RX-qbzmq05aEXPfKSBD-NTOmuIVeXCBTkIuGDHcrUAE,407
26
+ botpy/ext/convert_color/__init__.py,sha256=qGw0hSMzr4EhxcnSCcf0sgnznOKXAwZ_yKc_ennHVSY,1681
27
+ botpy/types/__init__.py,sha256=di48-mdXiCmkRrb_9frJ51-EnRAXPmYzX9oG_QF8oDY,131
28
+ botpy/types/announce.py,sha256=OYrf7ve0Db12HHBrUK_bJjAa14KaThF5nAA1ft7jYPc,474
29
+ botpy/types/audio.py,sha256=7yg3b4hTj7LrVeDUJQ78xzEDCIS3soOQSWcGZ-EzAa4,490
30
+ botpy/types/channel.py,sha256=U9-W9j3X02_PpHgSEauelU0_XvPYkn_oyqAiCrQUzqc,1613
31
+ botpy/types/emoji.py,sha256=DvJ937wYp-RBcK8sc91_FV1nslHrIY5ICisRmDyPVjU,205
32
+ botpy/types/forum.py,sha256=5jtsntdn3xDQg9a_gvUahn20A2kzFAr6Ft8juEbTePY,1251
33
+ botpy/types/gateway.py,sha256=anUGhJP6CDI8R4cYOMaIk3oNQrFR-G0XV4td2m-bcDA,1491
34
+ botpy/types/guild.py,sha256=elaQo8faXscGjmFkukZLVizFPHvFC3E_BWCaDGZZAP8,687
35
+ botpy/types/inline.py,sha256=lVpj5nasNPRrScPI0KVDolUrC5ZBq0H0jnZydF6LVfo,567
36
+ botpy/types/interaction.py,sha256=ht8ycncwi1iIABKcWprCq73IhcbU269lymQxHUfkkV4,756
37
+ botpy/types/message.py,sha256=ugTlFDX4Tdvi7xCQxt_qzkR34bfDZmiqN-abqxJTsQs,2551
38
+ botpy/types/permission.py,sha256=kdlfFJlYA3PcEOVT1q3awAyAo_0BBPbBKo-kvkfNqRo,383
39
+ botpy/types/pins_message.py,sha256=xEtQ1Zu91l3QrNZ757lddKO-CEpJfdJQBiFUGEcHwcM,134
40
+ botpy/types/reaction.py,sha256=BLeLzpdc45eekj8npwT4HnVEiwihKoaFM3lh1mRxfYY,569
41
+ botpy/types/rich_text.py,sha256=rEEtFzB7__1vyZORIhlC9Zt29erySDDNglhCfpGWu4I,2119
42
+ botpy/types/robot.py,sha256=mkJdzxSFM_SYEyWXrkHDqF_ecTLErQX-dsDtdaXthrQ,101
43
+ botpy/types/schedule.py,sha256=gfignsYnpY8QQpnfO9g3v5ZmKOcxGY7OIDLMrTLZgJs,566
44
+ botpy/types/session.py,sha256=pZmNHzLbTwHBiPNFjhO9_2aMPKiw0w28i3LW5He28lI,263
45
+ botpy/types/user.py,sha256=UgRZEFtIzh9hd4iyJ01aCDCn8zZFWTwdOYXunJcee7Q,344
46
+ b_botpy-1.0.0.dist-info/METADATA,sha256=iRV3rHOTUVLw4Sd8gzikjd74JHZD8Xjn2t-5okveapY,5787
47
+ b_botpy-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
48
+ b_botpy-1.0.0.dist-info/top_level.txt,sha256=4MbH6IzCsH2vdtSg5wJ9HvZ4y-OlkrfXjNi2vRHK5vk,6
49
+ b_botpy-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Tencent
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ botpy
botpy/__init__.py ADDED
@@ -0,0 +1,6 @@
1
+ # -*- coding: utf-8 -*-
2
+ from .logging import get_logger
3
+ from .client import *
4
+ from .flags import *
5
+
6
+ logger = get_logger()