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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9ed38bfb3d8f2f3607675516e5f8974f21b470d68f3d61e60e1679850d7f2e7 |
|
MD5 | 16031c795b7b0b2307a82973f6f6bf37 |
|
BLAKE2b-256 | a788891983ec7e99789ddbc1324c3bf26f2b793ea929390e3e4bcce1191c88ba |
Close
Hashes for nonebot_adapter_llbds-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32c365ab07152c3a63e5357933482d526b0523ee766222c2d63b916256b0f67f |
|
MD5 | bc1a1f2c9a7a5da971c003c5eda8bf08 |
|
BLAKE2b-256 | 3d44b4b007f22904648ca5fb78adf3124a442b42776883fa405914390fe2be22 |