Register a custom command.
(&mut self, cmd: Arc<dyn SlashCommand>)
| 142 | |
| 143 | /// Register a custom command. |
| 144 | pub fn register(&mut self, cmd: Arc<dyn SlashCommand>) { |
| 145 | self.commands.insert(cmd.name().to_string(), cmd); |
| 146 | } |
| 147 | |
| 148 | /// Unregister a command by name. |
| 149 | pub fn unregister(&mut self, name: &str) -> Option<Arc<dyn SlashCommand>> { |