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",
"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.6.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 048bd1c47f98b8efbbef86cb3b302ef110be65aea7da65b0c081bc6fa8f00d23 |
|
MD5 | c5fd86b4cdd1ef5c92f34b5d7b61ac07 |
|
BLAKE2b-256 | 553217c2373824eebf47349fa0bd04fd92adbd3b201593a08deb7b0e24d9ff69 |
Close
Hashes for nonebot_adapter_satori-0.6.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5337fe39202f32aedb37ecc24ad88fe0e6ec205b6b1cf02a7afca157385408ea |
|
MD5 | 7aebcc96dfe8b1a7f7ae549a9809d6a2 |
|
BLAKE2b-256 | 3227f011995ba4e483c6390fc710331083081b1fb0fa1262b3de1b4801e9ee75 |