Satori Protocol Adapter for Nonebot2
Project description
NoneBot-Adapter-Satori
✨ NoneBot2 Satori Protocol适配器 / Satori Protocol Adapter for NoneBot2 ✨
协议介绍
协议端
目前提供了 satori
协议实现的有:
- Chronocat
- Koishi (搭配
@koishijs/plugin-server
)
配置
修改 NoneBot 配置文件 .env
或者 .env.*
。
Driver
参考 driver 配置项,添加 HTTPClient
和 WebSocketClient
支持。
如:
DRIVER=~httpx+~websockets
DRIVER=~aiohttp
SATORI_CLIENTS
配置连接配置,如:
SATORI_CLIENTS='
[
{
"host": "localhost",
"port": "5500",
"path": "",
"token": "xxx"
}
]
'
host
与 port
为 Satori 服务端的监听地址与端口,
path
为 Satori 服务端自定义的监听路径,如 "/satori"
,默认为 ""
token
由 Satori 服务端决定是否需要。
示例
from nonebot import on_command
from nonebot.adapters.satori import Bot
from nonebot.adapters.satori.event import MessageEvent
from nonebot.adapters.satori.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!"))
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
Close
Hashes for nonebot_adapter_satori-0.8.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 150f7b4780235699dd5abb3f773a6b2b388c7d0e824f99686e24a96bcf41c295 |
|
MD5 | c9be17d528b4f13eb753ee8179a895f4 |
|
BLAKE2b-256 | 5598d9b32c0c032067c3ecc7f445d9c9003c94658d2decd747695f38b90372c7 |
Close
Hashes for nonebot_adapter_satori-0.8.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 890ece3518f75465b5d2bbbc55acf93c5fe9234a9f81748779cd4587862563b8 |
|
MD5 | 7e883811499eb00a5657ef1068dc46b4 |
|
BLAKE2b-256 | cfde8a63da7f0b8279aae7f24d6d857f95c8a1cbdd9bff1d765a3e33500746a2 |