SaluAi / src /Infrastructure /TelegramSaaS.API /Controllers /TelegramWebhookController.cs
Raghava Pulugu
Deploy app without exposed API tokens
7535af1
Raw
History Blame Contribute Delete
739 Bytes
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<IActionResult> ReceiveWebhook([FromBody] Update update)
{
if (update == null) return BadRequest();
await _updateService.HandleUpdateAsync(update);
return Ok();
}
}