mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-28 00:14:21 +00:00
chore: configurations
This commit is contained in:
@@ -10,11 +10,12 @@ class WecomConfigMigration(migration.Migration):
|
|||||||
async def need_migrate(self) -> bool:
|
async def need_migrate(self) -> bool:
|
||||||
"""判断当前环境是否需要运行此迁移"""
|
"""判断当前环境是否需要运行此迁移"""
|
||||||
|
|
||||||
for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
||||||
if adapter['adapter'] == 'wecom':
|
# if adapter['adapter'] == 'wecom':
|
||||||
return False
|
# return False
|
||||||
|
|
||||||
return True
|
# return True
|
||||||
|
return False
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
"""执行迁移"""
|
"""执行迁移"""
|
||||||
|
|||||||
@@ -10,11 +10,12 @@ class LarkConfigMigration(migration.Migration):
|
|||||||
async def need_migrate(self) -> bool:
|
async def need_migrate(self) -> bool:
|
||||||
"""判断当前环境是否需要运行此迁移"""
|
"""判断当前环境是否需要运行此迁移"""
|
||||||
|
|
||||||
for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
||||||
if adapter['adapter'] == 'lark':
|
# if adapter['adapter'] == 'lark':
|
||||||
return False
|
# return False
|
||||||
|
|
||||||
return True
|
# return True
|
||||||
|
return False
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
"""执行迁移"""
|
"""执行迁移"""
|
||||||
|
|||||||
@@ -10,11 +10,12 @@ class DiscordConfigMigration(migration.Migration):
|
|||||||
async def need_migrate(self) -> bool:
|
async def need_migrate(self) -> bool:
|
||||||
"""判断当前环境是否需要运行此迁移"""
|
"""判断当前环境是否需要运行此迁移"""
|
||||||
|
|
||||||
for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
||||||
if adapter['adapter'] == 'discord':
|
# if adapter['adapter'] == 'discord':
|
||||||
return False
|
# return False
|
||||||
|
|
||||||
return True
|
# return True
|
||||||
|
return False
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
"""执行迁移"""
|
"""执行迁移"""
|
||||||
|
|||||||
@@ -10,11 +10,12 @@ class GewechatConfigMigration(migration.Migration):
|
|||||||
async def need_migrate(self) -> bool:
|
async def need_migrate(self) -> bool:
|
||||||
"""判断当前环境是否需要运行此迁移"""
|
"""判断当前环境是否需要运行此迁移"""
|
||||||
|
|
||||||
for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
||||||
if adapter['adapter'] == 'gewechat':
|
# if adapter['adapter'] == 'gewechat':
|
||||||
return False
|
# return False
|
||||||
|
|
||||||
return True
|
# return True
|
||||||
|
return False
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
"""执行迁移"""
|
"""执行迁移"""
|
||||||
|
|||||||
@@ -10,11 +10,12 @@ class QQOfficialConfigMigration(migration.Migration):
|
|||||||
async def need_migrate(self) -> bool:
|
async def need_migrate(self) -> bool:
|
||||||
"""判断当前环境是否需要运行此迁移"""
|
"""判断当前环境是否需要运行此迁移"""
|
||||||
|
|
||||||
for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
||||||
if adapter['adapter'] == 'qqofficial':
|
# if adapter['adapter'] == 'qqofficial':
|
||||||
return False
|
# return False
|
||||||
|
|
||||||
return True
|
# return True
|
||||||
|
return False
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
"""执行迁移"""
|
"""执行迁移"""
|
||||||
|
|||||||
@@ -10,11 +10,12 @@ class WXOfficialAccountConfigMigration(migration.Migration):
|
|||||||
async def need_migrate(self) -> bool:
|
async def need_migrate(self) -> bool:
|
||||||
"""判断当前环境是否需要运行此迁移"""
|
"""判断当前环境是否需要运行此迁移"""
|
||||||
|
|
||||||
for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
||||||
if adapter['adapter'] == 'officialaccount':
|
# if adapter['adapter'] == 'officialaccount':
|
||||||
return False
|
# return False
|
||||||
|
|
||||||
return True
|
# return True
|
||||||
|
return False
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
"""执行迁移"""
|
"""执行迁移"""
|
||||||
|
|||||||
@@ -10,11 +10,12 @@ class DingTalkConfigMigration(migration.Migration):
|
|||||||
async def need_migrate(self) -> bool:
|
async def need_migrate(self) -> bool:
|
||||||
"""判断当前环境是否需要运行此迁移"""
|
"""判断当前环境是否需要运行此迁移"""
|
||||||
|
|
||||||
for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
|
||||||
if adapter['adapter'] == 'dingtalk':
|
# if adapter['adapter'] == 'dingtalk':
|
||||||
return False
|
# return False
|
||||||
|
|
||||||
return True
|
# return True
|
||||||
|
return False
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
"""执行迁移"""
|
"""执行迁移"""
|
||||||
|
|||||||
@@ -86,6 +86,11 @@
|
|||||||
"client_secret":"",
|
"client_secret":"",
|
||||||
"robot_code":"",
|
"robot_code":"",
|
||||||
"robot_name":""
|
"robot_name":""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"adapter":"telegram",
|
||||||
|
"enable": false,
|
||||||
|
"token":""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"track-function-calls": true,
|
"track-function-calls": true,
|
||||||
|
|||||||
@@ -432,6 +432,26 @@
|
|||||||
"description": "钉钉的robot_name"
|
"description": "钉钉的robot_name"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Telegram 适配器",
|
||||||
|
"description": "用于接入 Telegram",
|
||||||
|
"properties": {
|
||||||
|
"adapter": {
|
||||||
|
"type": "string",
|
||||||
|
"const": "telegram"
|
||||||
|
},
|
||||||
|
"enable": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false,
|
||||||
|
"description": "是否启用此适配器"
|
||||||
|
},
|
||||||
|
"token": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "",
|
||||||
|
"description": "Telegram 的 token"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user