chore: configurations

This commit is contained in:
Junyan Qin
2025-02-14 13:12:49 +08:00
parent 2b6be04c5d
commit 3e4b85aeb5
9 changed files with 60 additions and 28 deletions

View File

@@ -10,11 +10,12 @@ class WecomConfigMigration(migration.Migration):
async def need_migrate(self) -> bool:
"""判断当前环境是否需要运行此迁移"""
for adapter in self.ap.platform_cfg.data['platform-adapters']:
if adapter['adapter'] == 'wecom':
return False
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
# if adapter['adapter'] == 'wecom':
# return False
return True
# return True
return False
async def run(self):
"""执行迁移"""

View File

@@ -10,11 +10,12 @@ class LarkConfigMigration(migration.Migration):
async def need_migrate(self) -> bool:
"""判断当前环境是否需要运行此迁移"""
for adapter in self.ap.platform_cfg.data['platform-adapters']:
if adapter['adapter'] == 'lark':
return False
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
# if adapter['adapter'] == 'lark':
# return False
return True
# return True
return False
async def run(self):
"""执行迁移"""

View File

@@ -10,11 +10,12 @@ class DiscordConfigMigration(migration.Migration):
async def need_migrate(self) -> bool:
"""判断当前环境是否需要运行此迁移"""
for adapter in self.ap.platform_cfg.data['platform-adapters']:
if adapter['adapter'] == 'discord':
return False
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
# if adapter['adapter'] == 'discord':
# return False
return True
# return True
return False
async def run(self):
"""执行迁移"""

View File

@@ -10,11 +10,12 @@ class GewechatConfigMigration(migration.Migration):
async def need_migrate(self) -> bool:
"""判断当前环境是否需要运行此迁移"""
for adapter in self.ap.platform_cfg.data['platform-adapters']:
if adapter['adapter'] == 'gewechat':
return False
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
# if adapter['adapter'] == 'gewechat':
# return False
return True
# return True
return False
async def run(self):
"""执行迁移"""

View File

@@ -10,11 +10,12 @@ class QQOfficialConfigMigration(migration.Migration):
async def need_migrate(self) -> bool:
"""判断当前环境是否需要运行此迁移"""
for adapter in self.ap.platform_cfg.data['platform-adapters']:
if adapter['adapter'] == 'qqofficial':
return False
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
# if adapter['adapter'] == 'qqofficial':
# return False
return True
# return True
return False
async def run(self):
"""执行迁移"""

View File

@@ -10,11 +10,12 @@ class WXOfficialAccountConfigMigration(migration.Migration):
async def need_migrate(self) -> bool:
"""判断当前环境是否需要运行此迁移"""
for adapter in self.ap.platform_cfg.data['platform-adapters']:
if adapter['adapter'] == 'officialaccount':
return False
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
# if adapter['adapter'] == 'officialaccount':
# return False
return True
# return True
return False
async def run(self):
"""执行迁移"""

View File

@@ -10,11 +10,12 @@ class DingTalkConfigMigration(migration.Migration):
async def need_migrate(self) -> bool:
"""判断当前环境是否需要运行此迁移"""
for adapter in self.ap.platform_cfg.data['platform-adapters']:
if adapter['adapter'] == 'dingtalk':
return False
# for adapter in self.ap.platform_cfg.data['platform-adapters']:
# if adapter['adapter'] == 'dingtalk':
# return False
return True
# return True
return False
async def run(self):
"""执行迁移"""

View File

@@ -86,6 +86,11 @@
"client_secret":"",
"robot_code":"",
"robot_name":""
},
{
"adapter":"telegram",
"enable": false,
"token":""
}
],
"track-function-calls": true,

View File

@@ -432,6 +432,26 @@
"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"
}
}
}
]
}