Implement stop command

This commit is contained in:
2025-12-17 11:34:08 -06:00
parent f2c1c9c905
commit ad53858cda
+13 -2
View File
@@ -36,12 +36,23 @@ pub async fn start(
pub async fn stop(
event: &OriginalSyncRoomMessageEvent,
room: &Room,
ctx: Ctx<MagbotContext>,
mut ctx: Ctx<MagbotContext>,
) -> anyhow::Result<()> {
let user = event.sender.to_string();
// clear out saved titles
ctx.0.titles.clear();
// set state to sleeping
ctx.0.status = MagbotStatus::Sleeping;
// send message that magbot is no longer listening
todo!()
let msg = RoomMessageEventContent::text_plain(format!(
"{user} Magbot is no longer listening for titles!"
));
room.send(msg).await?;
Ok(())
}
/// Shows available commands