more tracing

This commit is contained in:
Xiretza 2022-11-13 10:57:47 +01:00
parent cc09f22432
commit efce5f22d6

View file

@ -57,6 +57,7 @@ pub enum OpenState {
Closed,
}
#[instrument(skip(api))]
async fn get_open_state(api: &ItsApi) -> Result<OpenState> {
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(());
};