Anelegant mirai-api-http v2 Python SDK.
Project description
Ariadne
another elegant framework for mirai and mirai-api-http v2
接受当下, 面向未来.
API 文档 部署状态:
入门文档部署状态:
一个适用于 mirai-api-http v2 的 Python SDK.
本项目适用于 mirai-api-http 2.0 以上版本.
目前仍处于开发阶段, 内部接口可能会有较大的变化.
安装
poetry add graia-ariadne
或
pip install graia-ariadne
使用
import asyncio
from graia.broadcast import Broadcast
from graia.ariadne.adapter import DefaultAdapter
from graia.ariadne.app import Ariadne
from graia.ariadne.message.chain import MessageChain
from graia.ariadne.message.element import Plain
from graia.ariadne.model import Friend, MiraiSession
loop = asyncio.new_event_loop()
app = Ariadne(MiraiSession(host="http://localhost:8080", verify_key="ServiceVerifyKey", account=123456789)))
@app.broadcast.receiver("FriendMessage")
async def friend_message_listener(app: Ariadne, friend: Friend):
await app.sendMessage(friend, MessageChain.create([Plain("Hello, World!")]))
loop.run_until_complete(app.lifecycle())
更多信息请看 文档.
讨论
QQ 交流群: 邀请链接
文档
协议
本项目以GNU 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file graia-ariadne-0.4.0rc0.tar.gz.
File metadata
- Download URL: graia-ariadne-0.4.0rc0.tar.gz
- Upload date:
- Size: 57.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.9.6 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3de8a47721184012d0c18853ad125b407b21cd9288c25c1e05098ab95fc431d8
|
|
| MD5 |
c4a1f42a808f7bd8f4b6365679f04161
|
|
| BLAKE2b-256 |
a36efd593efbc83423da850e0da3a73c314f78c562c9a5e9af8700a22dcdffa1
|
File details
Details for the file graia_ariadne-0.4.0rc0-py3-none-any.whl.
File metadata
- Download URL: graia_ariadne-0.4.0rc0-py3-none-any.whl
- Upload date:
- Size: 65.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.9.6 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2af7c0c131be4c4faa5bf013ef081f2f0a3d189eb3722677e2e2312cc53d9296
|
|
| MD5 |
0efc6e835046a5bdf8ecc21ae798c3ca
|
|
| BLAKE2b-256 |
435aacf8b66066ca5ed3f61ac0486b5707ce891e5898c6bd50d6c641dbe04af9
|