Version: 2.8.0
nonebot.adapters.feishu.adapter
class Adapter(driver, **kwargs)
-
参数
-
driver(Driver) -
**kwargs(Any)
-
class-var event_models
-
类型: StringTrie
-
说明: 所有事件模型索引
classmethod get_name()
-
说明: 适配器名称:
Feishu -
参数
empty
-
返回
- str
async method startup()
-
参数
empty
-
返回
- untyped
method setup()
-
参数
empty
-
返回
- None
method get_api_base(bot_config)
-
参数
bot_config(BotConfig)
-
返回
- URL
method get_api_url(bot_config, path)
-
参数
-
bot_config(BotConfig) -
path(str)
-
-
返回
- untyped
async method get_bot_info(bot_config)
-
参数
bot_config(BotConfig)
-
返回
- untyped
async method get_tenant_access_token(bot_config)
-
参数
bot_config(BotConfig)
-
返回
- untyped
async method send_request(request, **data)
-
参数
-
request(Request) -
**data(Any)
-
-
返回
- untyped
classmethod json_to_event(json_data)
-
说明: 将 json 数据转换为 Event 对象。
-
参数
-
json_data(Any): json 数据 -
self_id: 当前 Event 对应的 Bot
-
-
返回
- Event | None: Event 对象,如果解析失败则返回 None
classmethod add_custom_model(model)
-
说明: 插入或覆盖一个自定义的 Event 类型。 需提供
__event__属性,进行事件模型索引, 格式为{post_type}[.{sub_type}],如:message.private。 -
参数
model(type[Event]): 自定义的 Event 类型
-
返回
- None
classmethod get_event_model(event_name)
-
说明: 根据事件名获取对应
Event Model及FallBack Event Model列表, 不包括基类Event。 -
参数
event_name(str)
-
返回
- list[type[Event]]
classmethod custom_send(send_func)
-
说明: 自定义 Bot 的回复函数。
-
参数
send_func((Bot, Event, str | Message | MessageSegment) -> Any)
-
返回
- untyped