Skip to content

Commit 287aacb

Browse files
committed
Triagebot learned the read cmd
Meeting attendees are invited to read a document and notify when they start and when they finish reading the document. Closes #1613
1 parent 13ece7c commit 287aacb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/zulip.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ fn handle_command<'a>(
181181
})
182182
.unwrap(),
183183
},
184+
Some("read") => return match post_waiter(&ctx, message_data, WaitingMessage::start_reading()).await {
185+
Ok(r) => r,
186+
Err(e) => serde_json::to_string(&Response {
187+
content: &format!("Failed to await at this time: {:?}", e),
188+
})
189+
.unwrap(),
190+
},
184191
_ => {}
185192
}
186193
}
@@ -749,6 +756,13 @@ impl WaitingMessage<'static> {
749756
emoji: &["working_on_it", "all_good"],
750757
}
751758
}
759+
fn start_reading() -> Self {
760+
WaitingMessage {
761+
primary: "Click on the :book: when you start reading (and leave it clicked).\n\
762+
Click on the :checkered_flag: when you finish reading.",
763+
emoji: &["book", "checkered_flag"],
764+
}
765+
}
752766
}
753767

754768
async fn post_waiter(

0 commit comments

Comments
 (0)