(bots []dto.AgentFeishuBot)
| 1587 | } |
| 1588 | |
| 1589 | func getDefaultFeishuBot(bots []dto.AgentFeishuBot) dto.AgentFeishuBot { |
| 1590 | for _, bot := range bots { |
| 1591 | if bot.IsDefault || bot.AccountID == "default" { |
| 1592 | bot.IsDefault = true |
| 1593 | if bot.Name == "" { |
| 1594 | bot.Name = "Default" |
| 1595 | } |
| 1596 | return bot |
| 1597 | } |
| 1598 | } |
| 1599 | if len(bots) > 0 { |
| 1600 | bot := bots[0] |
| 1601 | bot.IsDefault = true |
| 1602 | if bot.AccountID == "" { |
| 1603 | bot.AccountID = "default" |
| 1604 | } |
| 1605 | if bot.Name == "" { |
| 1606 | bot.Name = "Default" |
| 1607 | } |
| 1608 | return bot |
| 1609 | } |
| 1610 | return defaultFeishuBot() |
| 1611 | } |
| 1612 | |
| 1613 | func getDefaultQQBot(bots []dto.AgentQQBotBot) dto.AgentQQBotBot { |
| 1614 | for _, bot := range bots { |
no test coverage detected