sonicbot_matrix/essentials/on_event/
left.rs1use crate::{Instructions, instruction_generators::RoomTypeData, EventArgs};
3pub fn help() -> String {
6 String::from("Runs on all syncs that have left rooms states")
7}
8
9pub fn main(event_args: EventArgs) -> Vec<Instructions> {
10 let mut instructions: Vec<Instructions> = Vec::new();
11 if let RoomTypeData::Left(ref x) = event_args.room_data {
12 for (room_id, _left_room) in x.iter() {
13 instructions.push(Instructions::DelRoom(room_id.clone()))
14 }
15 }
16 instructions
17}