Satori Protocol Adapter for Nonebot2
Project description
NoneBot-Adapter-Satori
✨ NoneBot2 Satori Protocol适配器 / Satori Protocol Adapter for NoneBot2 ✨
协议介绍
协议端
目前提供了 satori
协议实现的有:
- Chronocat
- Satori
- Koishi (搭配
@koishijs/plugin-server
)
配置
修改 NoneBot 配置文件 .env
或者 .env.*
。
Driver
参考 driver 配置项,添加 HTTPClient
和 WebSocketClient
支持。
如:
DRIVER=~httpx+~websockets
DRIVER=~aiohttp
SATORI_CLIENTS
配置连接配置,如:
SATORI_CLIENTS='
[
{
"host": "localhost",
"port": "5500",
"token": "xxx"
}
]
'
host
与 port
为 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.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a322c7d55822524c38c742964c81a4156c3fb9c6cd08351461e63bcc66c00ab0 |
|
MD5 | fe6fa53867c2653813ef4f030f07f5e9 |
|
BLAKE2b-256 | 4d3cc8ba9fa4fc4cb39baa7a8666b92496c6a4d81f1488e9467b0a3d1c330dad |
Close
Hashes for nonebot_adapter_satori-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c87378d6fef0e6bd92578226077bb8e04250d3026dc502a0f511073ee68b1256 |
|
MD5 | 1c5a36731cb26261f90ee10ee2735ed3 |
|
BLAKE2b-256 | df327504e306de62d54b2bd213008fb8de9f21439408c7d2f1961e330320194a |