Method
get_by_category
(&self, category: &CommandCategory)
Source from the content-addressed store, hash-verified
| 521 | } |
| 522 | |
| 523 | pub fn get_by_category(&self, category: &CommandCategory) -> Vec<&SlashCommand> { |
| 524 | self.by_category |
| 525 | .get(category) |
| 526 | .map(|names| { |
| 527 | names |
| 528 | .iter() |
| 529 | .filter_map(|name| self.commands.get(name)) |
| 530 | .collect() |
| 531 | }) |
| 532 | .unwrap_or_default() |
| 533 | } |
| 534 | |
| 535 | pub fn all_commands(&self) -> Vec<&SlashCommand> { |
| 536 | let mut seen = std::collections::HashSet::new(); |
Callers
nothing calls this directly
Tested by
no test coverage detected