using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Telegram.Bot.Types; using TelegramSaaS.Application.Common.Interfaces.Services; namespace TelegramSaaS.API.Controllers; [ApiController] [Route("api/v1/telegram")] public class TelegramWebhookController : ControllerBase { private readonly ITelegramUpdateService _updateService; public TelegramWebhookController(ITelegramUpdateService updateService) { _updateService = updateService; } [HttpPost("webhook")] public async Task ReceiveWebhook([FromBody] Update update) { if (update == null) return BadRequest(); await _updateService.HandleUpdateAsync(update); return Ok(); } }