mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
aw shit, here we go again
This commit is contained in:
@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Telegram.Bot;
|
||||
using Telegram.Bot.Types;
|
||||
@@ -33,7 +34,7 @@ namespace Kruzya.TelegramBot.Core.Controllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public IActionResult Index()
|
||||
public async IActionResult Index()
|
||||
{
|
||||
if (_secretToken != null && !Request.Headers.ContainsKey(SecretTokenHeader))
|
||||
{
|
||||
@@ -48,7 +49,8 @@ namespace Kruzya.TelegramBot.Core.Controllers
|
||||
return BadRequest();
|
||||
}
|
||||
|
||||
LaunchHandle(JsonConvert.DeserializeObject<Update>(Request.Body.ToString()));
|
||||
var body = await (new StreamReader(Request.Body)).ReadToEndAsync();
|
||||
LaunchHandle(JsonConvert.DeserializeObject<Update>(body));
|
||||
return Ok();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user