Skip to content

Commit

Permalink
Fix logging (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keroosha authored Jan 10, 2024
1 parent c66fa83 commit 9d8b5b0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/VahterBanBot/Bot.fs
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,11 @@ let aggregateUnbanResultInLogMsg message targetUserId targetUsername =

let softBanResultInLogMsg (message: Message) (duration: int) =
let logMsgBuilder = StringBuilder()
%logMsgBuilder.Append $"Vahter @{message.From.Username}({message.From.Id}) "
%logMsgBuilder.Append $"softbanned @{message.ReplyToMessage.From.Username}({message.ReplyToMessage.From.Id}) "
%logMsgBuilder.Append $"in @{message.Chat.Username}({message.Chat.Id}) "
%logMsgBuilder.Append $"until {DateTime.Now.AddHours duration}"
let untilDate = (DateTime.Now.AddHours duration).ToString "u"
%logMsgBuilder.Append $"Vahter {prependUsername message.From.Username}({message.From.Id}) "
%logMsgBuilder.Append $"softbanned {prependUsername message.ReplyToMessage.From.Username}({message.ReplyToMessage.From.Id}) "
%logMsgBuilder.Append $"in {prependUsername message.Chat.Username}({message.Chat.Id}) "
%logMsgBuilder.Append $"until {untilDate}"
string logMsgBuilder


Expand Down

0 comments on commit 9d8b5b0

Please sign in to comment.