forked from nolan/titlebot-ng-ng
Implement stop command
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user