This commit is contained in:
Jonathan Flueren 2023-07-06 17:22:03 +02:00
parent b7f0b50aad
commit d92a067934

View file

@ -150,18 +150,6 @@ async fn on_room_message(event: OriginalSyncRoomMessageEvent, room: Room) {
println!("message sent"); 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") { if text_content.body.contains("!timo") {
let reaction = ReactionEventContent::new( let reaction = ReactionEventContent::new(
Annotation::new( Annotation::new(
@ -184,4 +172,29 @@ async fn on_room_message(event: OriginalSyncRoomMessageEvent, room: Room) {
room.send(reaction, None).await.unwrap(); 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();
}
}
} }