NoneBot2 LLBDS适配器 / LLBDS Adapter for NoneBot2
Project description
NoneBot-Adapter-LLBDS
✨ LiteLoaderBDS适配 ✨
注意事项
适配器使用 thread.join()
方法,会导致一定程度的阻塞。因此,建议用户在内网中运行 LLBDS 和 NoneBot2,并减少适配器提供的接口的高频使用
适配器目前尚未完善,欢迎在 bot.py 中补充 API (LLEventBridge那边也是),在 event.py 中补充事件!
配置
参数 | 类型 | 描述 | 默认值 |
---|---|---|---|
LLBDS_TOKEN | str | LLBDS令牌,用于连接ws时进行身份验证 | 无 |
LLBDS_SERVER_ID | Optional[str] | LLBDS服务器ID,作为机器人的self_id,可留空 | LLBDS |
LLBDS_API_URL | Optional[str] | LLBDS API地址,例如 http://127.0.0.1:8081 |
http://127.0.0.1:8081 |
驱动
DRIVER=~fastapi+~aiohttp
LLBDS
示例插件
from nonebot import on_notice, on_command
from nonebot.params import CommandArg
from nonebot.log import logger
from nonebot_adapter_llbds.event import JoinEvent, MessageEvent
from nonebot_adapter_llbds.message import Message
notice = on_notice()
echo = on_command("echo", aliases={"回声"})
@notice.handle()
async def handle_join(event: JoinEvent):
event.player.sendText("Hello, world!")
@echo.handle()
async def handle_echo(event: MessageEvent, message: Message = CommandArg()):
await echo.send(message)
logger.info(f"玩家 {event.player.name} 发送了 {event.message}")
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_llbds-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b5df1d7b15f8351e6485804e41a083930649052a11bf0502bc8a4404cc69eca |
|
MD5 | f81a8b4516a2f757afdda9de14d254c1 |
|
BLAKE2b-256 | 76749cd5cae88d758bec1ccde81518feaf613a17a1db790407c43dc15d071288 |
Close
Hashes for nonebot_adapter_llbds-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e9f91d2254dd4e60d6c499279a138f3ba7d9c6c1f9ec9ddfa7738528227415f |
|
MD5 | e7f89e2b2d8cc40f290e9e0f16719206 |
|
BLAKE2b-256 | cabec1e7e85d172cb0e6b869dc368c5958e15766a0a1733145d984197066aa5e |