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.9.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d7bbe451f6707b564b96e2bce7cd79f911db21c36434417afe30b35efd7f2f5 |
|
MD5 | 9d679e9a8d66639b2a0553aaba12e251 |
|
BLAKE2b-256 | 389e332ff095f0a58b1f2f01a556c59f3eb43d514cbd5de0e528f6566e765f8d |
Close
Hashes for nonebot_adapter_satori-0.9.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ea2b29fd46f0d9c9380a61df88d5e2a79f0de5fe4c574734c3b371db80b8038 |
|
MD5 | 9c6de4e93539a517759c90ba803f2869 |
|
BLAKE2b-256 | 49b737512abe44e81e71330aeb303260123309342401db5826d85885ddb74ab3 |