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.7.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f62b87182359beaf477e77b12a0ca665273de7a24833695514ff18817b23618 |
|
MD5 | 10dfe6cbc029ec34f67d81a10cbb38b3 |
|
BLAKE2b-256 | eb9a15248ffeb1d92bdae1ca4a31937d17e73b81abe3ed6f577f8be103daef89 |
Close
Hashes for nonebot_adapter_satori-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14a6e846c0f4e46077c28ca403e5f16d18162b63b6aa4eb68f9e6f52153ab138 |
|
MD5 | 44f43fa515cf5794b3c78149fc352577 |
|
BLAKE2b-256 | 487bb852b71de86bb284c42e4ad171e90da4bd987c6ef58a80a750ef26efbff0 |