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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 267c5b708ec2dd77b405d3ec779e817506e6d6914cc06688b529b43fe4288727 |
|
MD5 | 7cdefc3bc276c60503f905cd6da65626 |
|
BLAKE2b-256 | 1bdb14a3a46c1a2953175d24a83f7756ff28068649a7378eb896978e50db5c5f |
Close
Hashes for nonebot_adapter_satori-0.8.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25d9726a961b73b6900a4dba3a8ec4f5d228a6cb96078b542379c9d6c9d3cefe |
|
MD5 | 14f448b9bf5b707849850a1db3113226 |
|
BLAKE2b-256 | 44072e3faf3c809046885b4be8dff99677a2da809433dae8c8b14be8d1df17eb |