From f717e72de9c7808e2fb08613a4dc8a00a2bef8ab Mon Sep 17 00:00:00 2001 From: Pavel Zhur Date: Sat, 17 Aug 2024 17:26:37 +0300 Subject: [PATCH] hoping to fix the updates --- .../Functions/BotFunctions.cs | 4 ++-- .../Functions/ManagementFunctions.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OneShelf.Telegram/OneShelf.Telegram.Runner.Functions/Functions/BotFunctions.cs b/OneShelf.Telegram/OneShelf.Telegram.Runner.Functions/Functions/BotFunctions.cs index d175c5e3..0274e047 100644 --- a/OneShelf.Telegram/OneShelf.Telegram.Runner.Functions/Functions/BotFunctions.cs +++ b/OneShelf.Telegram/OneShelf.Telegram.Runner.Functions/Functions/BotFunctions.cs @@ -1,9 +1,9 @@ using System.Net; +using System.Text.Json; using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Http; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using Newtonsoft.Json; using OneShelf.Telegram.Processor.Model; using OneShelf.Telegram.Processor.Services; using Telegram.BotAPI.GettingUpdates; @@ -41,7 +41,7 @@ public async Task RegenerationsQueueTrigger( public async Task UpdatesQueueTrigger( [QueueTrigger(QueueNameUpdates)] string myQueueItem) { - var update = JsonConvert.DeserializeObject(myQueueItem) ?? throw new("Empty request body."); + var update = JsonSerializer.Deserialize(myQueueItem) ?? throw new("Empty request body."); await await _pipeline.ProcessSyncSafeAndDispose(update, null); } diff --git a/OneShelf.Telegram/OneShelf.Telegram.Runner.Functions/Functions/ManagementFunctions.cs b/OneShelf.Telegram/OneShelf.Telegram.Runner.Functions/Functions/ManagementFunctions.cs index df3de85e..e915adc4 100644 --- a/OneShelf.Telegram/OneShelf.Telegram.Runner.Functions/Functions/ManagementFunctions.cs +++ b/OneShelf.Telegram/OneShelf.Telegram.Runner.Functions/Functions/ManagementFunctions.cs @@ -1,10 +1,10 @@ using System.Net; +using System.Text.Json; using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Http; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using Newtonsoft.Json; using OneShelf.Common.Database.Songs; using OneShelf.Telegram.Processor.Model; using Telegram.BotAPI; @@ -102,7 +102,7 @@ public async Task GetWebHook([HttpTrigger(AuthorizationLevel.A var response = req.CreateResponse(HttpStatusCode.OK); response.Headers.Add("Content-Type", "text/plain; charset=utf-8"); - await response.WriteStringAsync(JsonConvert.SerializeObject(await _api.GetWebhookInfoAsync())); + await response.WriteStringAsync(JsonSerializer.Serialize(await _api.GetWebhookInfoAsync())); return response; }