Fix command parsing
This commit is contained in:
parent
59034086e9
commit
c6cee44421
1 changed files with 5 additions and 6 deletions
|
@ -162,14 +162,13 @@ async fn parse_message(event: SyncMessageEvent<MessageEventContent>, room: Joine
|
|||
};
|
||||
|
||||
if let Some(message) = message.strip_prefix("!") {
|
||||
if let Some((command, args)) = message.split_once(" ") {
|
||||
let (command, args) = message.split_once(" ").unwrap_or((message, ""));
|
||||
match command {
|
||||
"source" => source(room).await?,
|
||||
"uwu" => uwuify(room, args).await?,
|
||||
_ => unsupported_command(event, room, command).await?,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue