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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d9ee8882f680a90c86402f434c12986260e9126107f7772b5491f8588b1b4a3 |
|
MD5 | 23a4aeab613a31c98db1361a8fb58bcb |
|
BLAKE2b-256 | 538ef6e8b6d982b5aa9e42b02e3839c537a827c62a4e8d59daf644705b122562 |
Close
Hashes for nonebot_adapter_satori-0.8.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b668588dde0dcce0aa0029880adb0b5e6d4641b14bd0a61dcb916390e34bc33 |
|
MD5 | cf24673c75edae59d56e2204b898d5c8 |
|
BLAKE2b-256 | 6431c24c5478868af4d16cfbd52371e33b174f67c10115ca1edd9e41f13b9032 |