mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
fix: build and lots of obsolete warnings
This commit is contained in:
@@ -3,10 +3,9 @@ using BotFramework.Config;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Telegram.Bot;
|
||||
using Telegram.Bot.Types;
|
||||
|
||||
namespace Kruzya.TelegramBot.Core.Controllers
|
||||
@@ -16,14 +15,12 @@ namespace Kruzya.TelegramBot.Core.Controllers
|
||||
private const string SecretTokenHeader = "X-Telegram-Bot-Api-Secret-Token";
|
||||
|
||||
private readonly ILogger<Telegram> _logger;
|
||||
private readonly ITelegramBotClient _client;
|
||||
private readonly IUpdateTarget _updateTarget;
|
||||
private readonly string _secretToken;
|
||||
|
||||
public Telegram(ILogger<Telegram> logger, ITelegramBotClient client, IUpdateTarget updateTarget, IOptions<BotConfig> config)
|
||||
public Telegram(ILogger<Telegram> logger, IUpdateTarget updateTarget, IOptions<BotConfig> config)
|
||||
{
|
||||
_logger = logger;
|
||||
_client = client;
|
||||
_updateTarget = updateTarget;
|
||||
|
||||
_secretToken = config.Value.Webhook.SecretToken;
|
||||
@@ -50,7 +47,7 @@ namespace Kruzya.TelegramBot.Core.Controllers
|
||||
}
|
||||
|
||||
var body = await (new StreamReader(Request.Body)).ReadToEndAsync();
|
||||
LaunchHandle(JsonConvert.DeserializeObject<Update>(body));
|
||||
LaunchHandle(JsonSerializer.Deserialize<Update>(body));
|
||||
return Ok();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user