/
Iceneo
/
WellTracker
Обзор
Документация
Войти
/
Iceneo
/
WellTracker
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
API/TelegramBot/Commands/TgNotificationBindingCommand.cs
32 строки
1 KB
Anton Yaskov
Добавил Тг бота
22 окт 2025, 22:09
22 окт 2025, 22:09
9a582aa
Код
Авторство
О чём код?
using Telegram.Bot; using Telegram.Bot.Types; using Telegram.Bot.Types.Enums; using TelegramBot.DTO; namespace TelegramBot.Commands; public class TgNotificationBindingCommand( ) : ITgCommand { public const string BindNotificationCommand = "Привязать уведомления"; public static readonly string[] Commands = [BindNotificationCommand]; public string[] GetCommands() => Commands; public async Task<TelegramMessage> HandleUpdate(Update update) { var message = update.Message!; var (text, chat) = (message.Text, message.Chat); if (text == BindNotificationCommand) { return new( chat.Id, @$"Ваш Id чата: `{chat.Id}`\. Укажите его в настройках аккаунта, чтобы получать уведомления здесь", ParseMode: ParseMode.MarkdownV2); } throw new ArgumentException(); } } public record Test(int a, int? b = null, int? c = null);