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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4af328ce4819b8edf1800548ca5d3fb60442f752ec3890bdde76a5faa35032c0 |
|
MD5 | 13c1cc42b71ebab5cacab16846d32628 |
|
BLAKE2b-256 | e894454f4daf2be96a8fbc09b50b5bcda0b5ca7e14dc8778634ea861cdb0e227 |
Close
Hashes for nonebot_adapter_satori-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf93617bd4e9954bf2195ad4c2e3c7944084d6e29558941efc1e2b7cfce6a110 |
|
MD5 | 94594cd5befbcd8c974862fae2c77583 |
|
BLAKE2b-256 | 80244a0c37929c2a3b435b933da2de87405efae1e75ef5e467bfa7d1b577de5d |