Spaces:
Sleeping
Sleeping
| using System; | |
| using System.Threading.Tasks; | |
| using Microsoft.AspNetCore.Mvc; | |
| using Telegram.Bot.Types; | |
| using TelegramSaaS.Application.Common.Interfaces.Services; | |
| namespace TelegramSaaS.API.Controllers; | |
| [] | |
| [] | |
| public class TelegramWebhookController : ControllerBase | |
| { | |
| private readonly ITelegramUpdateService _updateService; | |
| public TelegramWebhookController(ITelegramUpdateService updateService) | |
| { | |
| _updateService = updateService; | |
| } | |
| [] | |
| public async Task<IActionResult> ReceiveWebhook([FromBody] Update update) | |
| { | |
| if (update == null) return BadRequest(); | |
| await _updateService.HandleUpdateAsync(update); | |
| return Ok(); | |
| } | |
| } | |