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.9.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8183f44640f329c5e5807cc81042141a8e4d25c0df7d6d4ce88e27f565e18a30 |
|
MD5 | fcb89f6aff2c08e6eac48f017793dfe4 |
|
BLAKE2b-256 | 15f6df4acc0205b456b481629eeb5e55f89b8bd9817ce617e38fe6c500b84b1a |
Close
Hashes for nonebot_adapter_satori-0.9.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1b08758d463e1e3b03a29a5382ec65179b2ccc2315f7648a82a6a71de8a0c98 |
|
MD5 | 4b5eab8ab6cb37c93664921090ac28ce |
|
BLAKE2b-256 | c7b349560530c29fb7f6dfbb4aa8f564bfe656cdf047e46771b2c73eec7cbcfa |