一个轻量级、低耦合的基于 mirai-api-http 的 Python SDK。
Project description
YiriMirai
一个轻量级、低耦合度的基于 mirai-api-http 的 Python SDK。
目前仍处于开发阶段,各种内容可能会有较大的变化。
安装
从 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, HTTPAdapter, FriendMessage, Plain
if __name__ == '__main__':
bot = Mirai(qq=12345678, adapter=HTTPAdapter(verify_key='your_verify_key', host='localhost', port=8080))
@bot.on(FriendMessage)
async def on_friend_message(event: FriendMessage):
if str(event.message_chain) == '你好':
await bot.send_friend_message(event.sender.id, [Plain('Hello World!')])
bot.run()
更多信息参看文档。
开源协议
本项目使用 AGPLv3 开源协议。
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.1.tar.gz
(34.9 kB
view hashes)
Built Distribution
yiri_mirai-0.1.1-py3-none-any.whl
(41.5 kB
view hashes)
Close
Hashes for yiri_mirai-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b68913eb0dfe2cc7d5b03f0027e89166e49afae655928487f2ca79f31e6e9a82 |
|
MD5 | d503ba7a6dcda07ce10aa31ae040798a |
|
BLAKE2b-256 | ac0b683a7857992fe912e1e738457d6d11ee69b0147e90cdb6ad485ca810ed6e |