mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-13 23:07:33 +08:00
feat: add multi-account weixin channel
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user