|
| 1 | +# nonebot.adapters.feishu.adapter |
| 2 | + |
| 3 | +## _class_ `Adapter(driver, **kwargs)` {#Adapter} |
| 4 | + |
| 5 | +- **参数** |
| 6 | + |
| 7 | + - `driver` (Driver) |
| 8 | + |
| 9 | + - `**kwargs` (Any) |
| 10 | + |
| 11 | +### _class-var_ `event_models` {#Adapter-event-models} |
| 12 | + |
| 13 | +- **类型:** StringTrie |
| 14 | + |
| 15 | +- **说明:** 所有事件模型索引 |
| 16 | + |
| 17 | +### _classmethod_ `get_name()` {#Adapter-get-name} |
| 18 | + |
| 19 | +- **说明:** 适配器名称: `Feishu` |
| 20 | + |
| 21 | +- **参数** |
| 22 | + |
| 23 | + empty |
| 24 | + |
| 25 | +- **返回** |
| 26 | + |
| 27 | + - str |
| 28 | + |
| 29 | +### _async method_ `startup()` {#Adapter-startup} |
| 30 | + |
| 31 | +- **参数** |
| 32 | + |
| 33 | + empty |
| 34 | + |
| 35 | +- **返回** |
| 36 | + |
| 37 | + - untyped |
| 38 | + |
| 39 | +### _method_ `setup()` {#Adapter-setup} |
| 40 | + |
| 41 | +- **参数** |
| 42 | + |
| 43 | + empty |
| 44 | + |
| 45 | +- **返回** |
| 46 | + |
| 47 | + - None |
| 48 | + |
| 49 | +### _method_ `get_api_base(bot_config)` {#Adapter-get-api-base} |
| 50 | + |
| 51 | +- **参数** |
| 52 | + |
| 53 | + - `bot_config` ([BotConfig](config.md#BotConfig)) |
| 54 | + |
| 55 | +- **返回** |
| 56 | + |
| 57 | + - URL |
| 58 | + |
| 59 | +### _method_ `get_api_url(bot_config, path)` {#Adapter-get-api-url} |
| 60 | + |
| 61 | +- **参数** |
| 62 | + |
| 63 | + - `bot_config` ([BotConfig](config.md#BotConfig)) |
| 64 | + |
| 65 | + - `path` (str) |
| 66 | + |
| 67 | +- **返回** |
| 68 | + |
| 69 | + - untyped |
| 70 | + |
| 71 | +### _async method_ `get_bot_info(bot_config)` {#Adapter-get-bot-info} |
| 72 | + |
| 73 | +- **参数** |
| 74 | + |
| 75 | + - `bot_config` ([BotConfig](config.md#BotConfig)) |
| 76 | + |
| 77 | +- **返回** |
| 78 | + |
| 79 | + - untyped |
| 80 | + |
| 81 | +### _async method_ `get_tenant_access_token(bot_config)` {#Adapter-get-tenant-access-token} |
| 82 | + |
| 83 | +- **参数** |
| 84 | + |
| 85 | + - `bot_config` ([BotConfig](config.md#BotConfig)) |
| 86 | + |
| 87 | +- **返回** |
| 88 | + |
| 89 | + - untyped |
| 90 | + |
| 91 | +### _async method_ `send_request(request, **data)` {#Adapter-send-request} |
| 92 | + |
| 93 | +- **参数** |
| 94 | + |
| 95 | + - `request` (Request) |
| 96 | + |
| 97 | + - `**data` (Any) |
| 98 | + |
| 99 | +- **返回** |
| 100 | + |
| 101 | + - untyped |
| 102 | + |
| 103 | +### _classmethod_ `json_to_event(json_data)` {#Adapter-json-to-event} |
| 104 | + |
| 105 | +- **说明:** 将 json 数据转换为 Event 对象。 |
| 106 | + |
| 107 | +- **参数** |
| 108 | + |
| 109 | + - `json_data` (Any): json 数据 |
| 110 | + |
| 111 | + - `self_id`: 当前 Event 对应的 Bot |
| 112 | + |
| 113 | +- **返回** |
| 114 | + |
| 115 | + - [Event](event.md#Event) | None: Event 对象,如果解析失败则返回 None |
| 116 | + |
| 117 | +### _classmethod_ `add_custom_model(model)` {#Adapter-add-custom-model} |
| 118 | + |
| 119 | +- **说明:** 插入或覆盖一个自定义的 Event 类型。 需提供 `__event__` 属性,进行事件模型索引, 格式为 `{post_type}[.{sub_type}]`,如: `message.private`。 |
| 120 | + |
| 121 | +- **参数** |
| 122 | + |
| 123 | + - `model` (type[[Event](event.md#Event)]): 自定义的 Event 类型 |
| 124 | + |
| 125 | +- **返回** |
| 126 | + |
| 127 | + - None |
| 128 | + |
| 129 | +### _classmethod_ `get_event_model(event_name)` {#Adapter-get-event-model} |
| 130 | + |
| 131 | +- **说明:** 根据事件名获取对应 `Event Model` 及 `FallBack Event Model` 列表, 不包括基类 `Event`。 |
| 132 | + |
| 133 | +- **参数** |
| 134 | + |
| 135 | + - `event_name` (str) |
| 136 | + |
| 137 | +- **返回** |
| 138 | + |
| 139 | + - list[type[[Event](event.md#Event)]] |
| 140 | + |
| 141 | +### _classmethod_ `custom_send(send_func)` {#Adapter-custom-send} |
| 142 | + |
| 143 | +- **说明:** 自定义 Bot 的回复函数。 |
| 144 | + |
| 145 | +- **参数** |
| 146 | + |
| 147 | + - `send_func` (([Bot](bot.md#Bot), [Event](event.md#Event), str | [Message](message.md#Message) | [MessageSegment](message.md#MessageSegment)) -> Any) |
| 148 | + |
| 149 | +- **返回** |
| 150 | + |
| 151 | + - untyped |
0 commit comments