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",
"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.6.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdb67c9b2b5962bab50c0b5ef5ad5244dcf7a6504b5b19d140ecd5756044f1ec |
|
MD5 | adb2e4052785c70ecd64e8903c5536e9 |
|
BLAKE2b-256 | b2723209f77a63c9b09dce4c860e8115d0788cad6b4be5c7a10bc45bb6e257a7 |
Close
Hashes for nonebot_adapter_satori-0.6.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 723fc25c750b5faf0940c7ad11d74d4eaf0e05de151c0c9c4f3fe797cbe984f0 |
|
MD5 | 2dde9badf48f091d023eb106303c671c |
|
BLAKE2b-256 | 02fdda54afc6b6ea05fd2a29b69acd70052ebb773d1368c4c7b5aabb52e83292 |