2022-01-20 14:49:46 +08:00
|
|
|
"""本模块定义了协议适配基类,各协议请继承以下基类。
|
2021-08-29 00:24:28 +08:00
|
|
|
|
2022-01-22 15:23:07 +08:00
|
|
|
使用 {ref}`nonebot.drivers.Driver.register_adapter` 注册适配器。
|
|
|
|
|
|
|
|
FrontMatter:
|
|
|
|
sidebar_position: 0
|
|
|
|
description: nonebot.adapters 模块
|
2021-08-29 00:24:28 +08:00
|
|
|
"""
|
|
|
|
|
2021-02-19 15:24:52 +08:00
|
|
|
from typing import Iterable
|
2020-07-11 17:32:03 +08:00
|
|
|
|
2021-02-11 17:29:16 +08:00
|
|
|
try:
|
|
|
|
import pkg_resources
|
2021-11-22 23:21:26 +08:00
|
|
|
|
2021-02-11 17:29:16 +08:00
|
|
|
pkg_resources.declare_namespace(__name__)
|
|
|
|
del pkg_resources
|
|
|
|
except ImportError:
|
|
|
|
import pkgutil
|
2021-11-22 23:21:26 +08:00
|
|
|
|
|
|
|
__path__: Iterable[str] = pkgutil.extend_path(__path__, __name__) # type: ignore
|
2021-02-11 17:29:16 +08:00
|
|
|
del pkgutil
|
|
|
|
except Exception:
|
|
|
|
pass
|
|
|
|
|
2022-02-06 14:52:50 +08:00
|
|
|
from nonebot.internal.bot import Bot as Bot
|
|
|
|
from nonebot.internal.event import Event as Event
|
|
|
|
from nonebot.internal.adapter import Adapter as Adapter
|
|
|
|
from nonebot.internal.message import Message as Message
|
|
|
|
from nonebot.internal.message import MessageSegment as MessageSegment
|
|
|
|
from nonebot.internal.template import MessageTemplate as MessageTemplate
|
2022-01-17 15:06:53 +08:00
|
|
|
|
|
|
|
__autodoc__ = {
|
2022-02-06 14:52:50 +08:00
|
|
|
"Bot": True,
|
|
|
|
"Event": True,
|
|
|
|
"Adapter": True,
|
|
|
|
"Message": True,
|
|
|
|
"MessageSegment": True,
|
|
|
|
"MessageTemplate": True,
|
2022-01-17 15:06:53 +08:00
|
|
|
}
|