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