FuPro
This commit is contained in:
parent
b7f0b50aad
commit
d92a067934
1 changed files with 25 additions and 12 deletions
37
src/main.rs
37
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();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue