(bots []dto.AgentQQBotBot)
| 1611 | } |
| 1612 | |
| 1613 | func getDefaultQQBot(bots []dto.AgentQQBotBot) dto.AgentQQBotBot { |
| 1614 | for _, bot := range bots { |
| 1615 | if bot.IsDefault || bot.AccountID == "default" { |
| 1616 | bot.IsDefault = true |
| 1617 | if bot.Name == "" { |
| 1618 | bot.Name = "Default" |
| 1619 | } |
| 1620 | return bot |
| 1621 | } |
| 1622 | } |
| 1623 | if len(bots) > 0 { |
| 1624 | bot := bots[0] |
| 1625 | bot.IsDefault = true |
| 1626 | if bot.Name == "" { |
| 1627 | bot.Name = "Default" |
| 1628 | } |
| 1629 | return bot |
| 1630 | } |
| 1631 | return defaultQQBot() |
| 1632 | } |
no test coverage detected