remove new parameter for CommandHandler

This commit is contained in:
Suiranoil
2023-04-20 10:41:59 +03:00
parent 8f319c50a6
commit 4b8b48ab15
2 changed files with 5 additions and 3 deletions

View File

@@ -12,8 +12,10 @@ pub struct MixerCommandHandler {
}
impl MixerCommandHandler {
pub fn new(commands: HashMap<String, Box<dyn MixerCommand>>) -> Self {
Self { commands }
pub fn new() -> Self {
Self {
commands: HashMap::new(),
}
}
pub fn add_command<T: MixerCommand + 'static>(&mut self, command: T) {

View File

@@ -25,7 +25,7 @@ pub struct MixerBot {
impl MixerBot {
pub fn new() -> Self {
Self {
command_handler: MixerCommandHandler::new(HashMap::new()),
command_handler: MixerCommandHandler::new(),
}
}