Skip to main content

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

参阅 LLEventBridge

示例插件

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_adapter_llbds-0.1.2.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

nonebot_adapter_llbds-0.1.2-py3-none-any.whl (11.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page