zhenxun_bot/zhenxun/builtin_plugins/platform/__init__.py
2024-10-20 19:24:47 +08:00

24 lines
553 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from pathlib import Path
import nonebot
from zhenxun.services.log import logger
path = Path(__file__).parent
try:
from nonebot.adapters.onebot.v11 import Bot
nonebot.load_plugins(str((path / "qq").resolve()))
except ImportError:
logger.warning("未安装 onebot-adapter无法加载QQ平台专用插件...")
try:
from nonebot.adapters.qq import Bot # noqa: F401
nonebot.load_plugins(str((path / "qq_api").resolve()))
except ImportError:
logger.warning("未安装 qq-adapter无法加载QQ官平台专用插件...")