Skip to main content

nonebot

NoneBot-Adapter-Milky

✨ NoneBot2 Milky 协议适配 / Milky Protocol Adapter for NoneBot2 ✨

协议介绍

Milky 协议

协议端

配置

修改 NoneBot 配置文件 .env 或者 .env.*。

Driver

参考 driver 配置项,添加 HTTPClient 和 WebSocketClient 支持。

如:

DRIVER=~httpx+~websockets

或

DRIVER=~aiohttp

如果你使用的是 Webhook 模式,则可以移除 WebSocketClient 支持,并添加 ASGI 支持。

如:

DRIVER=~httpx+~fastapi

或

DRIVER=~aiohttp+~fastapi

MILKY_CLIENTS

配置连接配置,如:

MILKY_CLIENTS='
[
  {
    "host": "localhost",
    "port": "8080",
    "access_token": "xxx",
    "secure": false
  }
]
'

host 与 port 为 Milky 协议端设置的监听地址与端口,

access_token 为可选项,具体情况以 Milky 协议端为准。

secure 为可选项,表示是否使用安全连接(即 wss:// 或 https://),默认为 false。

MILKY_WEBHOOK

如果你使用的是 Webhook 模式,则需要配置 MILKY_WEBHOOK。

MILKY_WEBHOOK='
{
  "host": "localhost",
  "port": "8081",
  "access_token": "xxx",
  "secure": false
}
'

host 与 port 为 Milky 协议端设置的监听地址与端口,

access_token 为可选项,具体情况以 Milky 协议端为准。

secure 为可选项,表示是否使用安全连接(即 wss:// 或 https://),默认为 false。

示例

from nonebot import on_command
from nonebot.adapters.milky import Bot
from nonebot.adapters.milky.event import MessageEvent
from nonebot.adapters.milky.message import MessageSegment


matcher = on_command("test")

@matcher.handle()
async def handle_receive(bot: Bot, event: MessageEvent):
    if event.is_private:
        await bot.send(event, MessageSegment.text("Hello, world!"))

Metadata

Release files for nonebot-adapter-milky 1.1.0

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

Source distribution (sdist)

Source distribution for nonebot-adapter-milky 1.1.0
File Size Uploaded Provenance Actions
nonebot_adapter_milky-1.1.0.tar.gz 26.0 kB Without provenance Details for nonebot_adapter_milky-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-adapter-milky 1.1.0
File Interpreter ABI Platform Actions
nonebot_adapter_milky-1.1.0-py3-none-any.whl Python 3 none any Details for nonebot_adapter_milky-1.1.0-py3-none-any.whl

Total release size: 53.6 kB

Release files / nonebot_adapter_milky-1.1.0.tar.gz

Download URL nonebot_adapter_milky-1.1.0.tar.gz
Size 26.0 kB
Tags Source
SHA-256 checksum
How to use checksums
40e735816f099a0b7ab74343a015ec5e825f0f44cfddfb613bfa36e2d7fc20d6
BLAKE2b-256 checksum
How to use checksums
361080352714273a310c573fe3aa53f83a5eca1f0d6d74f2a79462f43fe442f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.26.6 CPython/3.12.3 Linux/6.14.0-1017-azure

Release files / nonebot_adapter_milky-1.1.0-py3-none-any.whl

Download URL nonebot_adapter_milky-1.1.0-py3-none-any.whl
Size 27.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6a1e1653fe8de523c537d875ed8d99e1d0843e071da9847cdc8096158e40f0a
BLAKE2b-256 checksum
How to use checksums
b2b0b248f4489f4057393254d37efd1344863572a346a70441fe794fd0a21428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.26.6 CPython/3.12.3 Linux/6.14.0-1017-azure

Security for nonebot-adapter-milky 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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