mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 09:05:04 +08:00
✏️ add switcher for lark
This commit is contained in:
parent
c4e3309026
commit
18c6bea451
@ -31,6 +31,9 @@ sidebarDepth: 0
|
|||||||
* `tenant_access_token` / `feishu_tenant_access_token`: 请求飞书 API 后返回的租户密钥
|
* `tenant_access_token` / `feishu_tenant_access_token`: 请求飞书 API 后返回的租户密钥
|
||||||
|
|
||||||
|
|
||||||
|
* `reigon` / `feishu_or_lark`: 设置后端使用飞书服务器还是Lark服务器
|
||||||
|
|
||||||
|
|
||||||
# NoneBot.adapters.feishu.exception 模块
|
# NoneBot.adapters.feishu.exception 模块
|
||||||
|
|
||||||
|
|
||||||
|
@ -136,6 +136,9 @@ class Bot(BaseBot):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def api_root(self) -> str:
|
def api_root(self) -> str:
|
||||||
|
if self.feishu_config.region == "Lark" :
|
||||||
|
return "https://open.larksuite.com/open-apis/"
|
||||||
|
else:
|
||||||
return "https://open.feishu.cn/open-apis/"
|
return "https://open.feishu.cn/open-apis/"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -14,6 +14,8 @@ 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服务器,如留空则默认为飞书服务器
|
||||||
|
|
||||||
"""
|
"""
|
||||||
app_id: Optional[str] = Field(default=None, alias="feishu_app_id")
|
app_id: Optional[str] = Field(default=None, alias="feishu_app_id")
|
||||||
app_secret: Optional[str] = Field(default=None, alias="feishu_app_secret")
|
app_secret: Optional[str] = Field(default=None, alias="feishu_app_secret")
|
||||||
@ -22,6 +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")
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
extra = "ignore"
|
extra = "ignore"
|
||||||
|
Loading…
Reference in New Issue
Block a user