Skip to main content

YiriMirai

Licence PyPI Python Version Document CodeFactor

一个轻量级、低耦合度的基于 mirai-api-http 的 Python SDK。

本项目适用于 mirai-api-http 2.0 以上版本。

目前仍处于开发阶段,各种内容可能会有较大的变化。

安装

从 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) == '你好':
            await bot.send(event, 'Hello World!')

    bot.run()

更多信息参看文档或文档镜像。

社区

QQ 群:766952599(链接)

Github Discussion(链接)

Discord(链接)

开源协议

由于 mirai 及 mirai-api-http 均采用了 AGPL-3.0 开源协议,本项目同样采用 AGPL-3.0 协议。

请注意,AGPL-3.0 是传染性协议。如果你的项目引用了 YiriMirai,请在发布时公开源代码,并同样采用 AGPL-3.0 协议。

Release files for yiri-mirai-rc 0.2.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yiri-mirai-rc 0.2.7.3
File Size Uploaded
yiri_mirai_rc-0.2.7.3.tar.gz 65.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yiri-mirai-rc 0.2.7.3
File Interpreter ABI Platform
yiri_mirai_rc-0.2.7.3-py3-none-any.whl Python 3 none any Details

Total release size: 142.6 kB

Release files / yiri_mirai_rc-0.2.7.3.tar.gz

Download URL yiri_mirai_rc-0.2.7.3.tar.gz
Size 65.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0aed8babab3836335ed5100cf7e66db0c0861695285926d828a7f236348b3304
BLAKE2b-256 checksum
How to use checksums
2a30911b7b5aff3ae546a14303389094433c56ca144eb5d67e8be83e881bc21b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / yiri_mirai_rc-0.2.7.3-py3-none-any.whl

Download URL yiri_mirai_rc-0.2.7.3-py3-none-any.whl
Size 77.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eee4501ac3cc7e57c678564e4bb111de5158a28dab19246dd34d7d204a1b6bee
BLAKE2b-256 checksum
How to use checksums
f6194091cdc52953e387db7625ef076d8c4bfb3c474c4ffbedfb2156e4ec8ad1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.2.7.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page