Skip to content

Commit

Permalink
even more tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
Szer committed Nov 30, 2023
1 parent 24cf665 commit d85c83a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/VahterBanBot/Bot.fs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ let banOnReply
.StartActivity("deleteReplyMsg")
.SetTag("msgId", message.ReplyToMessage.MessageId)
.SetTag("chatId", message.Chat.Id)
.SetTag("chatUsername", message.Chat.Username)
do! botClient.DeleteMessageAsync(ChatId(message.Chat.Id), message.ReplyToMessage.MessageId)
|> safeTaskAwait (fun e -> logger.LogError ($"Failed to delete reply message {message.ReplyToMessage.MessageId} from chat {message.Chat.Id}", e))
}
Expand Down Expand Up @@ -250,6 +251,7 @@ let onUpdate
.StartActivity("deleteCmdMsg")
.SetTag("msgId", message.MessageId)
.SetTag("chatId", message.Chat.Id)
.SetTag("chatUsername", message.Chat.Username)
do! botClient.DeleteMessageAsync(ChatId(message.Chat.Id), message.MessageId)
|> safeTaskAwait (fun e -> logger.LogError ($"Failed to delete ping message {message.MessageId} from chat {message.Chat.Id}", e))
}
Expand All @@ -264,10 +266,11 @@ let onUpdate

// if message is not a command from authorized user, just save it ID to DB
else
use _ = botActivity.StartActivity("justMessage")
%banOnReplyActivity
.SetTag("userId", message.From.Id)
.SetTag("userUsername", message.From.Username)
use _ =
botActivity
.StartActivity("justMessage")
.SetTag("fromUserId", message.From.Id)
.SetTag("fromUsername", message.From.Username)
do!
message
|> DbMessage.newMessage
Expand Down

0 comments on commit d85c83a

Please sign in to comment.