mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-10-31 06:56:39 +00:00 
			
		
		
		
	🔧 add config for lark users
This commit is contained in:
		| @@ -136,7 +136,7 @@ class Bot(BaseBot): | |||||||
|  |  | ||||||
|     @property |     @property | ||||||
|     def api_root(self) -> str: |     def api_root(self) -> str: | ||||||
|         if self.feishu_config.region == "Lark" : |         if self.feishu_config.is_lark: | ||||||
|             return "https://open.larksuite.com/open-apis/" |             return "https://open.larksuite.com/open-apis/" | ||||||
|         else: |         else: | ||||||
|             return "https://open.feishu.cn/open-apis/" |             return "https://open.feishu.cn/open-apis/" | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ class Config(BaseModel): | |||||||
|       - ``encrypt_key`` / ``feishu_encrypt_key``: 飞书开放平台后台“事件订阅”处设置的 Encrypt Key |       - ``encrypt_key`` / ``feishu_encrypt_key``: 飞书开放平台后台“事件订阅”处设置的 Encrypt Key | ||||||
|       - ``verification_token`` / ``feishu_verification_token``: 飞书开放平台后台“事件订阅”处设置的 Verification Token |       - ``verification_token`` / ``feishu_verification_token``: 飞书开放平台后台“事件订阅”处设置的 Verification Token | ||||||
|       - ``tenant_access_token`` / ``feishu_tenant_access_token``: 请求飞书 API 后返回的租户密钥 |       - ``tenant_access_token`` / ``feishu_tenant_access_token``: 请求飞书 API 后返回的租户密钥 | ||||||
|       - ``region`` / ``feishu_or_lark``: 选择服务器,如为 ``"Lark"`` 则连接 Lark 服务器 |       - ``is_lark`` / ``feishu_is_lark``: 是否使用Lark(飞书海外版),默认为 false | ||||||
|  |  | ||||||
|     """ |     """ | ||||||
|     app_id: Optional[str] = Field(default=None, alias="feishu_app_id") |     app_id: Optional[str] = Field(default=None, alias="feishu_app_id") | ||||||
| @@ -24,7 +24,7 @@ class Config(BaseModel): | |||||||
|                                               alias="feishu_verification_token") |                                               alias="feishu_verification_token") | ||||||
|     tenant_access_token: Optional[str] = Field( |     tenant_access_token: Optional[str] = Field( | ||||||
|         default=None, alias="feishu_tenant_access_token") |         default=None, alias="feishu_tenant_access_token") | ||||||
|     region: Optional[str] = Field(default=None, alias="feishu_or_lark") |     is_lark: Optional[str] = Field(default=False, alias="feishu_is_lark") | ||||||
|  |  | ||||||
|     class Config: |     class Config: | ||||||
|         extra = "ignore" |         extra = "ignore" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user