🔧 add config for lark users

This commit is contained in:
StarHeartHunt 2021-08-16 17:30:52 +08:00
parent f63ef8d23b
commit 109cae6dac
2 changed files with 3 additions and 3 deletions

View File

@ -136,7 +136,7 @@ class Bot(BaseBot):
@property
def api_root(self) -> str:
if self.feishu_config.region == "Lark" :
if self.feishu_config.is_lark:
return "https://open.larksuite.com/open-apis/"
else:
return "https://open.feishu.cn/open-apis/"

View File

@ -14,7 +14,7 @@ class Config(BaseModel):
- ``encrypt_key`` / ``feishu_encrypt_key``: 飞书开放平台后台事件订阅处设置的 Encrypt Key
- ``verification_token`` / ``feishu_verification_token``: 飞书开放平台后台事件订阅处设置的 Verification Token
- ``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")
@ -24,7 +24,7 @@ class Config(BaseModel):
alias="feishu_verification_token")
tenant_access_token: Optional[str] = Field(
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:
extra = "ignore"