From d92a06793463d199e28a49c364b860babc825e24 Mon Sep 17 00:00:00 2001 From: Jonathan Flueren Date: Thu, 6 Jul 2023 17:22:03 +0200 Subject: [PATCH] FuPro --- src/main.rs | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index 91c276a..291f845 100644 --- a/src/main.rs +++ b/src/main.rs @@ -150,18 +150,6 @@ async fn on_room_message(event: OriginalSyncRoomMessageEvent, room: Room) { println!("message sent"); } -/* - if text_content.body.contains("!timo") || text_content.body.contains("!Timo") { - let content = RoomMessageEventContent::text_plain("☢️☢️☢️"); - - println!("sending"); - - room.send(content, None).await.unwrap(); - - println!("message sent"); - - }*/ - if text_content.body.contains("!timo") { let reaction = ReactionEventContent::new( Annotation::new( @@ -184,4 +172,29 @@ async fn on_room_message(event: OriginalSyncRoomMessageEvent, room: Room) { room.send(reaction, None).await.unwrap(); } + let room_name = match room.name() { + Some(name) => { + name + + }, + _ => { + String::from("") + } + }; + + + if room_name.contains("Spam") { + if text_content.body.contains("!lambda") { + let reaction = ReactionEventContent::new( + Annotation::new( + event.event_id.to_owned(), + "FuPro".to_owned() + ) + ); + + room.send(reaction, None).await.unwrap(); + + } + } + } \ No newline at end of file