Enhance Telegram bot integration and notification system
- Updated PnvBotUpdateHandler to improve message editing for login and activation requests, providing clearer feedback and removing lingering buttons. - Modified TelegramNotifier to include an optional button linking to the public site in user notifications. - Enhanced CloseTicketCommandHandler and ResolveTicketCommandHandler to notify users via Telegram when their support tickets are closed or resolved, improving user engagement. - Updated ITelegramNotifier interface documentation to reflect the new functionality of including a site link in user notifications.
This commit is contained in:
@@ -106,9 +106,13 @@ internal sealed class TelegramNotifier(ITelegramBotClient botClient, IIdentitySe
|
||||
if (!link.IsLinked || link.TelegramUserId is not { } telegramUserId)
|
||||
return;
|
||||
|
||||
InlineKeyboardMarkup? keyboard = null;
|
||||
if (!string.IsNullOrWhiteSpace(options.Value.PublicSiteUrl))
|
||||
keyboard = new InlineKeyboardMarkup(new[] { InlineKeyboardButton.WithUrl("🌐 Открыть на сайте", options.Value.PublicSiteUrl) });
|
||||
|
||||
try
|
||||
{
|
||||
await botClient.SendMessage(telegramUserId, message, cancellationToken: cancellationToken);
|
||||
await botClient.SendMessage(telegramUserId, message, replyMarkup: keyboard, cancellationToken: cancellationToken);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user