more tracing
This commit is contained in:
parent
cc09f22432
commit
efce5f22d6
1 changed files with 5 additions and 0 deletions
|
@ -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(());
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue