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
File details
Details for the file nonebot_adapter_llbds-0.1.2.tar.gz
.
File metadata
- Download URL: nonebot_adapter_llbds-0.1.2.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.11.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 812b86fdf855dac540439ac567366456687d7dc80556f086b605608fa84ff0ba |
|
MD5 | 3ffac837e88b2eb3795a85f91503ccd7 |
|
BLAKE2b-256 | 06816550771dbc8e77957e8204b0a5b9c558361e904354f8e2ad9566a5ea3db6 |
File details
Details for the file nonebot_adapter_llbds-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: nonebot_adapter_llbds-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.11.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 369552ade175ea05bc13e80038ee63d016e438601eab9ace27b5f8fe0a7989a7 |
|
MD5 | 63f09eaa3d1a27ebfe5bb32b5e0bc1b9 |
|
BLAKE2b-256 | 9f70f0ff680c87cf4f592d18affe1e3510b6f0abc3e2bfa8c3cfa1df7edb65ab |