()
| 510 | } |
| 511 | |
| 512 | func (m *appModel) commandCategories() []commands.Category { |
| 513 | categories := m.buildCommandCategories(m.ctx(), m) |
| 514 | if len(m.disabledCommands) == 0 { |
| 515 | return categories |
| 516 | } |
| 517 | filtered := make([]commands.Category, 0, len(categories)) |
| 518 | for _, cat := range categories { |
| 519 | items := make([]commands.Item, 0, len(cat.Commands)) |
| 520 | for _, item := range cat.Commands { |
| 521 | if m.disabledCommands[item.SlashCommand] { |
| 522 | continue |
| 523 | } |
| 524 | items = append(items, item) |
| 525 | } |
| 526 | if len(items) == 0 { |
| 527 | continue |
| 528 | } |
| 529 | cat.Commands = items |
| 530 | filtered = append(filtered, cat) |
| 531 | } |
| 532 | return filtered |
| 533 | } |
| 534 | |
| 535 | // chatPageOpts returns the chat.PageOption slice derived from the current |
| 536 | // appModel configuration (e.g. lean mode). |
no outgoing calls