using Telegram.Bot; using Telegram.Bot.Types; using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.ReplyMarkups; namespace JOBot.TClient.Infrastructure.Extensions; public static class TelegramBotClientExtensions { /// /// Extension method for auto-remove of reply keyboard if is null /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// public static Task SendMessageRemK( this ITelegramBotClient bot, ChatId chatId, string text, ParseMode parseMode = default, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, LinkPreviewOptions? linkPreviewOptions = null, int? messageThreadId = null, IEnumerable? entities = null, bool disableNotification = false, bool protectContent = false, string? messageEffectId = null, string? businessConnectionId = null, bool allowPaidBroadcast = false, CancellationToken cancellationToken = default) { replyMarkup ??= new ReplyKeyboardRemove(); return bot.SendMessage(chatId, text, parseMode, replyParameters, replyMarkup, linkPreviewOptions, messageThreadId, entities, disableNotification, protectContent, messageEffectId, businessConnectionId, allowPaidBroadcast, cancellationToken); } }