Version: 3.0.0
nonebot.adapters.feishu.adapter
def translate_errors()
-
说明: 把 larkify 的异常转换为 NoneBot 的异常。
-
参数
empty
-
返回
- Generator[None, None, None]
class Dispatcher(adapter, bot_config)
-
说明
把事件交给 NoneBot。
Webhook 的校验、解密和长连接的确认都由 larkify 完成,这里收到的事件已通过校验。
-
参数
-
adapter(Adapter) -
bot_config(BotConfig)
-
async method adispatch(data)
-
参数
data(Mapping[str, Any])
-
返回
- None
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 create_task(coroutine)
-
说明: 运行后台任务,并持有其引用直至结束。
-
参数
coroutine(Coroutine[Any, Any, None])
-
返回
- None
method get_api_base(bot_config)
-
参数
bot_config(BotConfig)
-
返回
- URL
method create_client(bot_config)
-
参数
bot_config(BotConfig)
-
返回
- Feishu[AppAuthStrategy]
async method get_bot_info(bot_config)
-
参数
bot_config(BotConfig)
-
返回
- BotInfoResponse
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