Skip to content

Commit

Permalink
changed start msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Szer committed Sep 26, 2023
1 parent f83107f commit eef023d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/VahterBanBot/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,19 @@ app.UseGiraffe(webApp)
let server = app.RunAsync()

let telegramClient = app.Services.GetRequiredService<ITelegramBotClient>()
telegramClient.SendTextMessageAsync(ChatId(botConf.LogsChannelId), "Bot started").Wait()

app.Logger.LogInformation("Bot started")
let startLogMsg =
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("ChatsToMonitor:")
for KeyValue(username, chatId) in botConf.ChatsToMonitor do
%sb.AppendLine($" {username} ({chatId})")
sb.ToString()

app.Logger.LogInformation startLogMsg
telegramClient.SendTextMessageAsync(ChatId(botConf.LogsChannelId), startLogMsg).Wait()

server.Wait()

0 comments on commit eef023d

Please sign in to comment.