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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 804a53978eb7c1c4e8b444769d4312ef5172d0e14eadd5c8649cf1b8dfecc7f9 |
|
MD5 | 6efd5298f6597140231a99caa82c334e |
|
BLAKE2b-256 | 4978f86f39ade87c055abb60124105961db6904be44071238eded614be650243 |
Close
Hashes for nonebot_adapter_satori-0.8.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e93c7fd66d70ed4c3921c648283f086367b5fc61a899dc253bf59b4331db32a |
|
MD5 | 03416728517b06513baf85597e5cbc21 |
|
BLAKE2b-256 | 53e2a9baab96f4e024b78272d1ff8c600099df6b0837a265ba12d2a3d576533a |