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
+5 -4
View File
@@ -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):
"""执行迁移""" """执行迁移"""
+5 -4
View File
@@ -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):
"""执行迁移""" """执行迁移"""
+5 -4
View File
@@ -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):
"""执行迁移""" """执行迁移"""
+5 -4
View File
@@ -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):
"""执行迁移""" """执行迁移"""
+5 -4
View File
@@ -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):
"""执行迁移""" """执行迁移"""
+5
View File
@@ -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,
+20
View File
@@ -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"
}
}
} }
] ]
} }