Satori Protocol Adapter for Nonebot2
Project description
NoneBot-Adapter-Satori
✨ NoneBot2 Satori Protocol适配器 / Satori Protocol Adapter for NoneBot2 ✨
协议介绍
协议端
目前提供了 satori
协议实现的有:
- Chronocat
- Satori
- Koishi (搭配
@koishijs/plugin-server
)
配置
修改 NoneBot 配置文件 .env
或者 .env.*
。
Driver
参考 driver 配置项,添加 ForwardDriver
支持。
如:
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.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 794e92955630a6d6d0fcf92857281572c09d67cf454f83bcd7a7b9498efbba9f |
|
MD5 | 576abbe3ce81d26aa5d114015dff4277 |
|
BLAKE2b-256 | 53c61fadeb096c3d25f234b1f8a8d39a5cb18018fc4e6e1dd10fe51ee7fc79b4 |
Close
Hashes for nonebot_adapter_satori-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd85feb1796bedd6d96ab241bd96c430f6292fb84ab38720cd525560b60dc36b |
|
MD5 | cc6d2ad4fc507d07dbc6d1a0259832e9 |
|
BLAKE2b-256 | a33dbe7f45cc67583e91b1bfee7f2a1e871960c2a3f635f442351a4a8b1846a0 |