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 配置项,添加 HTTPClient
和 WebSocketClient
支持。
如:
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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12a4660004ba97494d82bbba130599e8d928fd43a190ee8c603d85f63fb21475 |
|
MD5 | d0797198526bbe3e0977e9c275fa2b01 |
|
BLAKE2b-256 | 30cf6c277f5a87b0ae39e6f14e76e9c238b8b412d807144aea90eec9f78dbeec |
Close
Hashes for nonebot_adapter_satori-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a275fa30471d6c5e31bf7c99b90e16f7ed11dc5eefd5cb27a0f61f4cab32415e |
|
MD5 | fe41597f069c4128ee758765ddb7dc5f |
|
BLAKE2b-256 | 9baf8a12a91f5b1a21dd986d7831cb7b9f2c4095f04deb8fc37ca3b2853f3dc2 |