feat: add multi-account weixin channel

This commit is contained in:
lpf
2026-03-23 18:04:13 +08:00
parent 88fccb21ee
commit 8e2bf3c492
10 changed files with 1548 additions and 1 deletions

View File

@@ -188,6 +188,12 @@ func gatewayCmd() {
if whatsAppBridge != nil {
registryServer.SetWhatsAppBridge(whatsAppBridge, embeddedWhatsAppBridgeBasePath)
}
if rawWeixin, ok := channelManager.GetChannel("weixin"); ok {
if weixinChannel, ok := rawWeixin.(*channels.WeixinChannel); ok {
weixinChannel.SetConfigPath(getConfigPath())
registryServer.SetWeixinChannel(weixinChannel)
}
}
registryServer.SetCronHandler(func(action string, args map[string]interface{}) (interface{}, error) {
getStr := func(k string) string {
v, _ := args[k].(string)
@@ -424,6 +430,14 @@ func gatewayCmd() {
registryServer.SetWorkspacePath(cfg.WorkspacePath())
registryServer.SetLogFilePath(cfg.LogFilePath())
registryServer.SetWhatsAppBridge(whatsAppBridge, embeddedWhatsAppBridgeBasePath)
if rawWeixin, ok := channelManager.GetChannel("weixin"); ok {
if weixinChannel, ok := rawWeixin.(*channels.WeixinChannel); ok {
weixinChannel.SetConfigPath(getConfigPath())
registryServer.SetWeixinChannel(weixinChannel)
}
} else {
registryServer.SetWeixinChannel(nil)
}
sentinelService.Stop()
sentinelService = sentinel.NewService(
getConfigPath(),