From efce5f22d64056fdf4e92468916f370177b67e57 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sun, 13 Nov 2022 10:57:47 +0100 Subject: [PATCH] more tracing --- src/bot.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bot.rs b/src/bot.rs index 30294e4..0687ce3 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -57,6 +57,7 @@ pub enum OpenState { Closed, } +#[instrument(skip(api))] async fn get_open_state(api: &ItsApi) -> Result { let state = api .status() @@ -210,15 +211,19 @@ impl Bot { ev: &OriginalRoomMessageEvent, room: &Joined, ) -> Result<()> { + event!(Level::TRACE, ?ev, "handling message"); if Some(&*ev.sender) == self.client.user_id() { + event!(Level::TRACE, "message from ourselves, ignoring"); return Ok(()); } let MessageType::Text(TextMessageEventContent { body, .. }) = &ev.content.msgtype else { + event!(Level::TRACE, "non-plaintext message, ignoring"); return Ok(()); }; let Some(command) = body.strip_prefix(&self.config.app.command_prefix) else { + event!(Level::TRACE, "non-command message, ignoring"); return Ok(()); };