From c0636b82fab6b8843ba9ff3be68cf0e9fd012a67 Mon Sep 17 00:00:00 2001 From: Keroosha Date: Tue, 7 Feb 2023 22:15:46 +0300 Subject: [PATCH] Dates in UTC, remove trailing spaces --- PublishHelperBot/Handlers.fs | 4 ++-- PublishHelperBot/Program.fs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PublishHelperBot/Handlers.fs b/PublishHelperBot/Handlers.fs index e400398..7ffb5cb 100644 --- a/PublishHelperBot/Handlers.fs +++ b/PublishHelperBot/Handlers.fs @@ -34,7 +34,7 @@ let RelayCaptionType (command: string) = | _ when command.StartsWith "\\post" -> WithAuthor | _ -> Unknown -let RelayCaption (name: string, url: string) = $" Прислал {name}" +let RelayCaption (name: string, url: string) = $"Прислал {name}" let RelayParseMode = ParseMode.Html; let RelayResolveCaption (mode: RelayCaptionMode, username: string, linkUrl: string) = @@ -52,7 +52,7 @@ let public RelayMatch: HandlerRequirements = fun (u, c) -> let public RelayHandler: Handler = fun (u, c, tg) -> let reply = u.Message.ReplyToMessage let channelId = c.chanelId - let author = reply.From.FirstName + let author = $"{reply.From.FirstName} {reply.From.LastName}" let captionMode = RelayCaptionType u.Message.Text let photoMedia = lazy Array.get (ExtractPhotoFromMessage reply) 0 diff --git a/PublishHelperBot/Program.fs b/PublishHelperBot/Program.fs index 16231a6..c006fdc 100644 --- a/PublishHelperBot/Program.fs +++ b/PublishHelperBot/Program.fs @@ -14,7 +14,7 @@ open Telegram.Bot.Types.Enums let CreateBot (config: BotConfig, http: HttpClient) = TelegramBotClient(config.token, http) let config = CreateConfig <| "SBPB_CONFIG_PATH"; let botClient = CreateBot <| (config, new HttpClient()) -let startDate = DateTime.Now +let startDate = DateTime.UtcNow let updateHandle (bc: ITelegramBotClient) (u: Update) (ct: CancellationToken): Task = match u with