Skip to content

Commit

Permalink
added missed climutable
Browse files Browse the repository at this point in the history
  • Loading branch information
Szer committed Sep 28, 2023
1 parent b5ae0c4 commit aa63cea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/VahterBanBot/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ let server = app.RunAsync()
let telegramClient = app.Services.GetRequiredService<ITelegramBotClient>()

let startLogMsg =
let prependUsername (s: string) =
if s.StartsWith("@") then s else "@" + s
let sb = System.Text.StringBuilder()
%sb.AppendLine("Bot started with following configuration")
%sb.AppendLine("AllowedUsers:")
for KeyValue(username, userId) in botConf.AllowedUsers do
%sb.AppendLine($" {username} ({userId})")
%sb.AppendLine($" {prependUsername username} ({userId})")
%sb.AppendLine("ChatsToMonitor:")
for KeyValue(username, chatId) in botConf.ChatsToMonitor do
%sb.AppendLine($" {username} ({chatId})")
%sb.AppendLine($" {prependUsername username} ({chatId})")
sb.ToString()

app.Logger.LogInformation startLogMsg
Expand Down
1 change: 1 addition & 0 deletions src/VahterBanBot/Types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type DbUser =
module DbUser =
let banUser vahter reason (user: DbUser) = user.Ban(vahter, ?reason = reason)

[<CLIMutable>]
type DbMessage =
{ Chat_Id: int64
Message_Id: int
Expand Down

0 comments on commit aa63cea

Please sign in to comment.