ensure bot doesn't reply to its own messages

This commit is contained in:
Xiretza 2022-11-13 10:57:12 +01:00
parent c40de5fbd1
commit cc09f22432
1 changed files with 4 additions and 0 deletions

View File

@ -210,6 +210,10 @@ impl Bot {
ev: &OriginalRoomMessageEvent,
room: &Joined,
) -> Result<()> {
if Some(&*ev.sender) == self.client.user_id() {
return Ok(());
}
let MessageType::Text(TextMessageEventContent { body, .. }) = &ev.content.msgtype else {
return Ok(());
};