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='
[
{
"port": "localhost",
"host": "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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ed3763bc3f27cf9f8dd570db30a4059ae812ca53cf741b9c78088804752c77c |
|
MD5 | 0c66965c52849dd974a6ae330305cde6 |
|
BLAKE2b-256 | d51d7ba8bf41ca10a1461608409fd826db35a5868303749486cce508ae61eaa2 |
Close
Hashes for nonebot_adapter_satori-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4591d491ae534bae3e0306da8f00e7871543e806460356af2a6665399d520f96 |
|
MD5 | 4806b4631a9459488c0c5d2c31ae1acc |
|
BLAKE2b-256 | c64baccceda34b668b44ad5bd12d9a88f61589a3f1e95182acc25113f8757324 |