From cc09f22432ca51dfcaaefdb1daf8627a43b9effb Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sun, 13 Nov 2022 10:57:12 +0100 Subject: [PATCH] ensure bot doesn't reply to its own messages --- src/bot.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bot.rs b/src/bot.rs index 4febe51..30294e4 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -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(()); };