一个轻量级、低耦合的基于 mirai-api-http 的 Python SDK。
Project description
YiriMirai
一个轻量级、低耦合度的基于 mirai-api-http 的 Python SDK。
本项目适用于 mirai-api-http 2.X 版本。
目前仍处于开发阶段,各种内容可能会有较大的变化。
安装
从 PyPI 安装:
pip install yiri-mirai
# 或者使用 poetry
poetry add yiri-mirai
此外,你还可以克隆这个仓库到本地,然后使用 poetry
安装:
git clone git@github.com:Wybxc/YiriMirai.git
cd YiriMirai
poetry install
使用
from mirai import Mirai, FriendMessage, WebSocketAdapter
if __name__ == '__main__':
bot = Mirai(12345678, adapter=WebSocketAdapter(
verify_key='your_verify_key', host='localhost', port=6090
))
@bot.on(FriendMessage)
async def on_friend_message(event: FriendMessage):
if str(event.message_chain) == '你好':
return bot.send_friend_message(event.sender.id, ['Hello World!'])
bot.run()
更多信息参看文档。
开源协议
由于 mirai 及 mirai-api-http 均采用了 AGPL-3.0 开源协议,本项目同样采用 AGPL-3.0 协议。
请注意,AGPL-3.0 是传染性协议。如果你的项目引用了 YiriMirai,请在发布时公开源代码,并同样采用 AGPL-3.0 协议。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yiri-mirai-0.1.6.tar.gz
(50.6 kB
view hashes)
Built Distribution
yiri_mirai-0.1.6-py3-none-any.whl
(62.4 kB
view hashes)
Close
Hashes for yiri_mirai-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47d1c72a9af87cf3089f240e7181e9c6b11d76e2f925ebd8e3336e2441739c08 |
|
MD5 | 71ce6f8b6b1fbfe3993391b1ebf6a9f4 |
|
BLAKE2b-256 | cc2e6654aa10c1c6fd372321f93604f4d7ce280594382ddf2b5c7c7606646148 |