Repository: Eptagone/Telegram.BotAPI Branch: main Commit: e713ebd791e6 Files: 748 Total size: 3.3 MB Directory structure: gitextract_x_mrro30/ ├── .gitattributes ├── .github/ │ └── workflows/ │ ├── build.yaml │ ├── close-inactive-issues.yaml │ └── publish.yaml ├── .gitignore ├── LICENSE ├── README.md ├── src/ │ ├── .editorconfig │ ├── .gitignore │ ├── Telegram.BotAPI.sln │ ├── examples/ │ │ ├── .dockerignore │ │ ├── BotTemplate/ │ │ │ ├── BotTemplateSample.csproj │ │ │ ├── MyBot.cs │ │ │ ├── Program.cs │ │ │ └── readme.md │ │ ├── Callback query button 01/ │ │ │ ├── Callback query button 01.csproj │ │ │ ├── Program.cs │ │ │ └── readme.md │ │ ├── Examples.sln │ │ ├── Hello World/ │ │ │ ├── Hello World.csproj │ │ │ ├── Program.cs │ │ │ └── readme.md │ │ ├── HelloBotNET.AppService/ │ │ │ ├── HelloBotNET.AppService.csproj │ │ │ ├── Program.cs │ │ │ ├── Properties/ │ │ │ │ ├── launchSettings.json │ │ │ │ ├── serviceDependencies.json │ │ │ │ └── serviceDependencies.local.json │ │ │ ├── Services/ │ │ │ │ ├── HelloBot.CommandHandler.cs │ │ │ │ ├── HelloBot.ErrorHandler.cs │ │ │ │ ├── HelloBot.MessageHandler.cs │ │ │ │ ├── HelloBot.UpdateHandler.cs │ │ │ │ └── HelloBot.cs │ │ │ ├── Worker.cs │ │ │ ├── appsettings.Development.json │ │ │ ├── appsettings.json │ │ │ └── readme.md │ │ ├── HelloBotNET.Webhook/ │ │ │ ├── Controllers/ │ │ │ │ └── BotController.cs │ │ │ ├── Extensions/ │ │ │ │ └── ApplicationBuilderExtensions.cs │ │ │ ├── HelloBotNET.Webhook.csproj │ │ │ ├── Program.cs │ │ │ ├── Properties/ │ │ │ │ └── launchSettings.json │ │ │ ├── Services/ │ │ │ │ ├── HelloBot.CommandHandler.cs │ │ │ │ ├── HelloBot.ErrorHandler.cs │ │ │ │ ├── HelloBot.MessageHandler.cs │ │ │ │ ├── HelloBot.UpdateHandler.cs │ │ │ │ └── HelloBot.cs │ │ │ ├── appsettings.Development.json │ │ │ ├── appsettings.json │ │ │ └── readme.md │ │ ├── Poll Quiz 01/ │ │ │ ├── Poll Quiz 01.csproj │ │ │ ├── Program.cs │ │ │ └── readme.md │ │ ├── ReplyKeyboardMarkup 01/ │ │ │ ├── Program.cs │ │ │ ├── ReplyKeyboardMarkup 01.csproj │ │ │ └── readme.md │ │ ├── Telegram Calendar/ │ │ │ ├── Calendar.cs │ │ │ ├── CalendarBot.cs │ │ │ ├── Models/ │ │ │ │ ├── Day.cs │ │ │ │ ├── Month.cs │ │ │ │ └── MonthName.cs │ │ │ ├── Program.cs │ │ │ ├── Telegram Calendar.csproj │ │ │ └── readme.md │ │ └── readme.md │ ├── library/ │ │ ├── Telegram.BotAPI/ │ │ │ ├── Abstractions/ │ │ │ │ ├── ITelegramBot.cs │ │ │ │ ├── ITelegramBotClient.cs │ │ │ │ └── SendAttachedFilesArgsBase.cs │ │ │ ├── AvailableMethods/ │ │ │ │ ├── Args/ │ │ │ │ │ ├── AnswerCallbackQueryArgs.cs │ │ │ │ │ ├── AnswerGuestQueryArgs.cs │ │ │ │ │ ├── AnswerWebAppQueryArgs.cs │ │ │ │ │ ├── CopyMessageArgs.cs │ │ │ │ │ ├── CopyMessagesArgs.cs │ │ │ │ │ ├── CreateChatInviteLinkArgs.cs │ │ │ │ │ ├── DeleteBusinessMessagesArgs.cs │ │ │ │ │ ├── DeleteMyCommandsArgs.cs │ │ │ │ │ ├── EditChatInviteLinkArgs.cs │ │ │ │ │ ├── EditStoryArgs.cs │ │ │ │ │ ├── ForwardMessageArgs.cs │ │ │ │ │ ├── ForwardMessagesArgs.cs │ │ │ │ │ ├── GetBusinessAccountGiftsArgs.cs │ │ │ │ │ ├── GetChatGiftsArgs.cs │ │ │ │ │ ├── GetMyCommandsArgs.cs │ │ │ │ │ ├── GetUserGiftsArgs.cs │ │ │ │ │ ├── GiftPremiumSubscriptionArgs.cs │ │ │ │ │ ├── PostStoryArgs.cs │ │ │ │ │ ├── PromoteChatMemberArgs.cs │ │ │ │ │ ├── RepostStoryArgs.cs │ │ │ │ │ ├── RestrictChatMemberArgs.cs │ │ │ │ │ ├── SavePreparedInlineMessageArgs.cs │ │ │ │ │ ├── SavePreparedKeyboardButtonArgs.cs │ │ │ │ │ ├── SendAnimationArgs.cs │ │ │ │ │ ├── SendAudioArgs.cs │ │ │ │ │ ├── SendChecklistArgs.cs │ │ │ │ │ ├── SendContactArgs.cs │ │ │ │ │ ├── SendDiceArgs.cs │ │ │ │ │ ├── SendDocumentArgs.cs │ │ │ │ │ ├── SendGiftArgs.cs │ │ │ │ │ ├── SendLivePhotoArgs.cs │ │ │ │ │ ├── SendLocationArgs.cs │ │ │ │ │ ├── SendMediaGroupArgs.cs │ │ │ │ │ ├── SendMessageArgs.cs │ │ │ │ │ ├── SendMessageDraftArgs.cs │ │ │ │ │ ├── SendPaidMediaArgs.cs │ │ │ │ │ ├── SendPhotoArgs.cs │ │ │ │ │ ├── SendPollArgs.cs │ │ │ │ │ ├── SendVenueArgs.cs │ │ │ │ │ ├── SendVideoArgs.cs │ │ │ │ │ ├── SendVideoNoteArgs.cs │ │ │ │ │ ├── SendVoiceArgs.cs │ │ │ │ │ ├── SetBusinessAccountGiftSettingsArgs.cs │ │ │ │ │ ├── SetBusinessAccountProfilePhotoArgs.cs │ │ │ │ │ ├── SetChatMenuButtonArgs.cs │ │ │ │ │ ├── SetChatPermissionsArgs.cs │ │ │ │ │ ├── SetChatPhotoArgs.cs │ │ │ │ │ ├── SetManagedBotAccessSettingsArgs.cs │ │ │ │ │ ├── SetMessageReactionArgs.cs │ │ │ │ │ ├── SetMyCommandsArgs.cs │ │ │ │ │ ├── SetMyDefaultAdministratorRightsArgs.cs │ │ │ │ │ └── SetMyProfilePhotoArgs.cs │ │ │ │ ├── answerCallbackQuery.cs │ │ │ │ ├── answerGuestQuery.cs │ │ │ │ ├── answerWebAppQuery.cs │ │ │ │ ├── approveChatJoinRequest.cs │ │ │ │ ├── banChatMember.cs │ │ │ │ ├── banChatSenderChat.cs │ │ │ │ ├── close.cs │ │ │ │ ├── closeForumTopic.cs │ │ │ │ ├── closeGeneralForumTopic.cs │ │ │ │ ├── convertGiftToStars.cs │ │ │ │ ├── copyMessage.cs │ │ │ │ ├── copyMessages.cs │ │ │ │ ├── createChatInviteLink.cs │ │ │ │ ├── createChatSubscriptionInviteLink.cs │ │ │ │ ├── createForumTopic.cs │ │ │ │ ├── declineChatJoinRequest.cs │ │ │ │ ├── deleteBusinessMessages.cs │ │ │ │ ├── deleteChatPhoto.cs │ │ │ │ ├── deleteChatStickerSet.cs │ │ │ │ ├── deleteForumTopic.cs │ │ │ │ ├── deleteMyCommands.cs │ │ │ │ ├── deleteStory.cs │ │ │ │ ├── editChatInviteLink.cs │ │ │ │ ├── editChatSubscriptionInviteLink.cs │ │ │ │ ├── editForumTopic.cs │ │ │ │ ├── editGeneralForumTopic.cs │ │ │ │ ├── editStory.cs │ │ │ │ ├── exportChatInviteLink.cs │ │ │ │ ├── forwardMessage.cs │ │ │ │ ├── forwardMessages.cs │ │ │ │ ├── getAvailableGifts.cs │ │ │ │ ├── getBusinessAccountGifts.cs │ │ │ │ ├── getBusinessAccountStarBalance.cs │ │ │ │ ├── getBusinessConnection.cs │ │ │ │ ├── getChat.cs │ │ │ │ ├── getChatAdministrators.cs │ │ │ │ ├── getChatGifts.cs │ │ │ │ ├── getChatMember.cs │ │ │ │ ├── getChatMemberCount.cs │ │ │ │ ├── getChatMenuButton.cs │ │ │ │ ├── getFile.cs │ │ │ │ ├── getForumTopicIconStickers.cs │ │ │ │ ├── getManagedBotAccessSettings.cs │ │ │ │ ├── getManagedBotToken.cs │ │ │ │ ├── getMe.cs │ │ │ │ ├── getMyCommands.cs │ │ │ │ ├── getMyDefaultAdministratorRights.cs │ │ │ │ ├── getMyDescription.cs │ │ │ │ ├── getMyName.cs │ │ │ │ ├── getMyShortDescription.cs │ │ │ │ ├── getUserChatBoosts.cs │ │ │ │ ├── getUserGifts.cs │ │ │ │ ├── getUserPersonalChatMessages.cs │ │ │ │ ├── getUserProfileAudios.cs │ │ │ │ ├── getUserProfilePhotos.cs │ │ │ │ ├── giftPremiumSubscription.cs │ │ │ │ ├── hideGeneralForumTopic.cs │ │ │ │ ├── leaveChat.cs │ │ │ │ ├── logOut.cs │ │ │ │ ├── pinChatMessage.cs │ │ │ │ ├── postStory.cs │ │ │ │ ├── promoteChatMember.cs │ │ │ │ ├── readBusinessMessage.cs │ │ │ │ ├── removeBusinessAccountProfilePhoto.cs │ │ │ │ ├── removeChatVerification.cs │ │ │ │ ├── removeMyProfilePhoto.cs │ │ │ │ ├── removeUserVerification.cs │ │ │ │ ├── reopenForumTopic.cs │ │ │ │ ├── reopenGeneralForumTopic.cs │ │ │ │ ├── replaceManagedBotToken.cs │ │ │ │ ├── repostStory.cs │ │ │ │ ├── restrictChatMember.cs │ │ │ │ ├── revokeChatInviteLink.cs │ │ │ │ ├── savePreparedInlineMessage.cs │ │ │ │ ├── savePreparedKeyboardButton.cs │ │ │ │ ├── sendAnimation.cs │ │ │ │ ├── sendAudio.cs │ │ │ │ ├── sendChatAction.cs │ │ │ │ ├── sendChecklist.cs │ │ │ │ ├── sendContact.cs │ │ │ │ ├── sendDice.cs │ │ │ │ ├── sendDocument.cs │ │ │ │ ├── sendGift.cs │ │ │ │ ├── sendLivePhoto.cs │ │ │ │ ├── sendLocation.cs │ │ │ │ ├── sendMediaGroup.cs │ │ │ │ ├── sendMessage.cs │ │ │ │ ├── sendMessageDraft.cs │ │ │ │ ├── sendPaidMedia.cs │ │ │ │ ├── sendPhoto.cs │ │ │ │ ├── sendPoll.cs │ │ │ │ ├── sendVenue.cs │ │ │ │ ├── sendVideo.cs │ │ │ │ ├── sendVideoNote.cs │ │ │ │ ├── sendVoice.cs │ │ │ │ ├── setBusinessAccountBio.cs │ │ │ │ ├── setBusinessAccountGiftSettings.cs │ │ │ │ ├── setBusinessAccountName.cs │ │ │ │ ├── setBusinessAccountProfilePhoto.cs │ │ │ │ ├── setBusinessAccountUsername.cs │ │ │ │ ├── setChatAdministratorCustomTitle.cs │ │ │ │ ├── setChatDescription.cs │ │ │ │ ├── setChatMemberTag.cs │ │ │ │ ├── setChatMenuButton.cs │ │ │ │ ├── setChatPermissions.cs │ │ │ │ ├── setChatPhoto.cs │ │ │ │ ├── setChatStickerSet.cs │ │ │ │ ├── setChatTitle.cs │ │ │ │ ├── setManagedBotAccessSettings.cs │ │ │ │ ├── setMessageReaction.cs │ │ │ │ ├── setMyCommands.cs │ │ │ │ ├── setMyDefaultAdministratorRights.cs │ │ │ │ ├── setMyDescription.cs │ │ │ │ ├── setMyName.cs │ │ │ │ ├── setMyProfilePhoto.cs │ │ │ │ ├── setMyShortDescription.cs │ │ │ │ ├── setUserEmojiStatus.cs │ │ │ │ ├── transferBusinessAccountStars.cs │ │ │ │ ├── transferGift.cs │ │ │ │ ├── unbanChatMember.cs │ │ │ │ ├── unbanChatSenderChat.cs │ │ │ │ ├── unhideGeneralForumTopic.cs │ │ │ │ ├── unpinAllChatMessages.cs │ │ │ │ ├── unpinAllForumTopicMessages.cs │ │ │ │ ├── unpinAllGeneralForumTopicMessages.cs │ │ │ │ ├── unpinChatMessage.cs │ │ │ │ ├── upgradeGift.cs │ │ │ │ ├── verifyChat.cs │ │ │ │ └── verifyUser.cs │ │ │ ├── AvailableTypes/ │ │ │ │ ├── AcceptedGiftTypes.cs │ │ │ │ ├── Animation.cs │ │ │ │ ├── Audio.cs │ │ │ │ ├── BackgroundFill/ │ │ │ │ │ ├── BackgroundFill.cs │ │ │ │ │ ├── BackgroundFillFreeformGradient.cs │ │ │ │ │ ├── BackgroundFillGradient.cs │ │ │ │ │ └── BackgroundFillSolid.cs │ │ │ │ ├── BackgroundType/ │ │ │ │ │ ├── BackgroundType.cs │ │ │ │ │ ├── BackgroundTypeChatTheme.cs │ │ │ │ │ ├── BackgroundTypeFill.cs │ │ │ │ │ ├── BackgroundTypePattern.cs │ │ │ │ │ └── BackgroundTypeWallpaper.cs │ │ │ │ ├── Birthdate.cs │ │ │ │ ├── BotAccessSettings.cs │ │ │ │ ├── BotCommand.cs │ │ │ │ ├── BotCommandScope/ │ │ │ │ │ ├── BotCommandScope.cs │ │ │ │ │ ├── BotCommandScopeAllChatAdministrators.cs │ │ │ │ │ ├── BotCommandScopeAllGroupChats.cs │ │ │ │ │ ├── BotCommandScopeAllPrivateChats.cs │ │ │ │ │ ├── BotCommandScopeChat.cs │ │ │ │ │ ├── BotCommandScopeChatAdministrators.cs │ │ │ │ │ ├── BotCommandScopeChatMember.cs │ │ │ │ │ └── BotCommandScopeDefault.cs │ │ │ │ ├── BotDescription.cs │ │ │ │ ├── BotName.cs │ │ │ │ ├── BotShortDescription.cs │ │ │ │ ├── BusinessBotRights.cs │ │ │ │ ├── BusinessConnection.cs │ │ │ │ ├── BusinessIntro.cs │ │ │ │ ├── BusinessLocation.cs │ │ │ │ ├── BusinessMessagesDeleted.cs │ │ │ │ ├── BusinessOpeningHours.cs │ │ │ │ ├── BusinessOpeningHoursInterval.cs │ │ │ │ ├── CallbackQuery.cs │ │ │ │ ├── Chat/ │ │ │ │ │ ├── Chat.cs │ │ │ │ │ └── ChatFullInfo.cs │ │ │ │ ├── ChatAdministratorRights.cs │ │ │ │ ├── ChatBackground.cs │ │ │ │ ├── ChatBoost.cs │ │ │ │ ├── ChatBoostAdded.cs │ │ │ │ ├── ChatBoostRemoved.cs │ │ │ │ ├── ChatBoostSource/ │ │ │ │ │ ├── ChatBoostSource.cs │ │ │ │ │ ├── ChatBoostSourceGiftCode.cs │ │ │ │ │ ├── ChatBoostSourceGiveaway.cs │ │ │ │ │ └── ChatBoostSourcePremium.cs │ │ │ │ ├── ChatBoostUpdated.cs │ │ │ │ ├── ChatInviteLink.cs │ │ │ │ ├── ChatJoinRequest.cs │ │ │ │ ├── ChatLocation.cs │ │ │ │ ├── ChatMember/ │ │ │ │ │ ├── ChatMember.cs │ │ │ │ │ ├── ChatMemberAdministrator.cs │ │ │ │ │ ├── ChatMemberBanned.cs │ │ │ │ │ ├── ChatMemberLeft.cs │ │ │ │ │ ├── ChatMemberMember.cs │ │ │ │ │ ├── ChatMemberOwner.cs │ │ │ │ │ └── ChatMemberRestricted.cs │ │ │ │ ├── ChatMemberUpdated.cs │ │ │ │ ├── ChatOwnerChanged.cs │ │ │ │ ├── ChatOwnerLeft.cs │ │ │ │ ├── ChatPermissions.cs │ │ │ │ ├── ChatPhoto.cs │ │ │ │ ├── ChatShared.cs │ │ │ │ ├── Checklist.cs │ │ │ │ ├── ChecklistTask.cs │ │ │ │ ├── ChecklistTasksAdded.cs │ │ │ │ ├── ChecklistTasksDone.cs │ │ │ │ ├── Contact.cs │ │ │ │ ├── CopyTextButton.cs │ │ │ │ ├── Dice.cs │ │ │ │ ├── DirectMessagePriceChanged.cs │ │ │ │ ├── DirectMessagesTopic.cs │ │ │ │ ├── Document.cs │ │ │ │ ├── ExternalReplyInfo.cs │ │ │ │ ├── File.cs │ │ │ │ ├── ForumTopic.cs │ │ │ │ ├── ForumTopicClosed.cs │ │ │ │ ├── ForumTopicCreated.cs │ │ │ │ ├── ForumTopicEdited.cs │ │ │ │ ├── ForumTopicReopened.cs │ │ │ │ ├── GeneralForumTopicHidden.cs │ │ │ │ ├── GeneralForumTopicUnhidden.cs │ │ │ │ ├── Gift.cs │ │ │ │ ├── GiftBackground.cs │ │ │ │ ├── GiftInfo.cs │ │ │ │ ├── Gifts.cs │ │ │ │ ├── Giveaway.cs │ │ │ │ ├── GiveawayCompleted.cs │ │ │ │ ├── GiveawayCreated.cs │ │ │ │ ├── GiveawayWinners.cs │ │ │ │ ├── InlineKeyboardButton.cs │ │ │ │ ├── InputChecklist.cs │ │ │ │ ├── InputChecklistTask.cs │ │ │ │ ├── InputFile.cs │ │ │ │ ├── InputMedia/ │ │ │ │ │ ├── InputMedia.cs │ │ │ │ │ ├── InputMediaAnimation.cs │ │ │ │ │ ├── InputMediaAudio.cs │ │ │ │ │ ├── InputMediaDocument.cs │ │ │ │ │ ├── InputMediaLivePhoto.cs │ │ │ │ │ ├── InputMediaLocation.cs │ │ │ │ │ ├── InputMediaPhoto.cs │ │ │ │ │ ├── InputMediaSticker.cs │ │ │ │ │ ├── InputMediaVenue.cs │ │ │ │ │ └── InputMediaVideo.cs │ │ │ │ ├── InputPaidMedia/ │ │ │ │ │ ├── InputPaidMedia.cs │ │ │ │ │ ├── InputPaidMediaLivePhoto.cs │ │ │ │ │ ├── InputPaidMediaPhoto.cs │ │ │ │ │ └── InputPaidMediaVideo.cs │ │ │ │ ├── InputPollOption.cs │ │ │ │ ├── InputProfilePhoto/ │ │ │ │ │ ├── InputProfilePhoto.cs │ │ │ │ │ ├── InputProfilePhotoAnimated.cs │ │ │ │ │ └── InputProfilePhotoStatic.cs │ │ │ │ ├── InputStoryContent/ │ │ │ │ │ ├── InputStoryContent.cs │ │ │ │ │ ├── InputStoryContentPhoto.cs │ │ │ │ │ └── InputStoryContentVideo.cs │ │ │ │ ├── KeyboardButton.cs │ │ │ │ ├── KeyboardButtonPollType.cs │ │ │ │ ├── KeyboardButtonRequestChat.cs │ │ │ │ ├── KeyboardButtonRequestManagedBot.cs │ │ │ │ ├── KeyboardButtonRequestUsers.cs │ │ │ │ ├── LinkPreviewOptions.cs │ │ │ │ ├── LivePhoto.cs │ │ │ │ ├── Location.cs │ │ │ │ ├── LocationAddress.cs │ │ │ │ ├── LoginUrl.cs │ │ │ │ ├── ManagedBotCreated.cs │ │ │ │ ├── ManagedBotUpdated.cs │ │ │ │ ├── MaybeInaccessibleMessage/ │ │ │ │ │ ├── InaccessibleMessage.cs │ │ │ │ │ ├── MaybeInaccessibleMessage.cs │ │ │ │ │ └── Message.cs │ │ │ │ ├── MenuButton/ │ │ │ │ │ ├── MenuButton.cs │ │ │ │ │ ├── MenuButtonCommands.cs │ │ │ │ │ ├── MenuButtonDefault.cs │ │ │ │ │ └── MenuButtonWebApp.cs │ │ │ │ ├── MessageAutoDeleteTimerChanged.cs │ │ │ │ ├── MessageEntity.cs │ │ │ │ ├── MessageID.cs │ │ │ │ ├── MessageOrigin/ │ │ │ │ │ ├── MessageOrigin.cs │ │ │ │ │ ├── MessageOriginChannel.cs │ │ │ │ │ ├── MessageOriginChat.cs │ │ │ │ │ ├── MessageOriginHiddenUser.cs │ │ │ │ │ └── MessageOriginUser.cs │ │ │ │ ├── MessageReactionCountUpdated.cs │ │ │ │ ├── MessageReactionUpdated.cs │ │ │ │ ├── OwnedGift/ │ │ │ │ │ ├── OwnedGift.cs │ │ │ │ │ ├── OwnedGiftRegular.cs │ │ │ │ │ └── OwnedGiftUnique.cs │ │ │ │ ├── OwnedGifts.cs │ │ │ │ ├── PaidMedia/ │ │ │ │ │ ├── PaidMedia.cs │ │ │ │ │ ├── PaidMediaLivePhoto.cs │ │ │ │ │ ├── PaidMediaPhoto.cs │ │ │ │ │ ├── PaidMediaPreview.cs │ │ │ │ │ └── PaidMediaVideo.cs │ │ │ │ ├── PaidMediaInfo.cs │ │ │ │ ├── PaidMessagePriceChanged.cs │ │ │ │ ├── PhotoSize.cs │ │ │ │ ├── Poll.cs │ │ │ │ ├── PollAnswer.cs │ │ │ │ ├── PollMedia.cs │ │ │ │ ├── PollOption.cs │ │ │ │ ├── PollOptionAdded.cs │ │ │ │ ├── PollOptionDeleted.cs │ │ │ │ ├── PreparedInlineMessage.cs │ │ │ │ ├── PreparedKeyboardButton.cs │ │ │ │ ├── ProximityAlertTriggered.cs │ │ │ │ ├── ReactionCount.cs │ │ │ │ ├── ReactionType/ │ │ │ │ │ ├── ReactionType.cs │ │ │ │ │ ├── ReactionTypeCustomEmoji.cs │ │ │ │ │ ├── ReactionTypeEmoji.cs │ │ │ │ │ └── ReactionTypePaid.cs │ │ │ │ ├── ReplyMarkup/ │ │ │ │ │ ├── ForceReply.cs │ │ │ │ │ ├── InlineKeyboardMarkup.cs │ │ │ │ │ ├── ReplyKeyboardMarkup.cs │ │ │ │ │ ├── ReplyKeyboardRemove.cs │ │ │ │ │ └── ReplyMarkup.cs │ │ │ │ ├── ReplyParameters.cs │ │ │ │ ├── ResponseParameters.cs │ │ │ │ ├── SentGuestMessage.cs │ │ │ │ ├── SentWebAppMessage.cs │ │ │ │ ├── SharedUser.cs │ │ │ │ ├── StarAmount.cs │ │ │ │ ├── Story.cs │ │ │ │ ├── StoryArea.cs │ │ │ │ ├── StoryAreaPosition.cs │ │ │ │ ├── StoryAreaType/ │ │ │ │ │ ├── StoryAreaType.cs │ │ │ │ │ ├── StoryAreaTypeLink.cs │ │ │ │ │ ├── StoryAreaTypeLocation.cs │ │ │ │ │ ├── StoryAreaTypeSuggestedReaction.cs │ │ │ │ │ ├── StoryAreaTypeUniqueGift.cs │ │ │ │ │ └── StoryAreaTypeWeather.cs │ │ │ │ ├── SuggestedPostApprovalFailed.cs │ │ │ │ ├── SuggestedPostApproved.cs │ │ │ │ ├── SuggestedPostDeclined.cs │ │ │ │ ├── SuggestedPostInfo.cs │ │ │ │ ├── SuggestedPostPaid.cs │ │ │ │ ├── SuggestedPostParameters.cs │ │ │ │ ├── SuggestedPostPrice.cs │ │ │ │ ├── SuggestedPostRefunded.cs │ │ │ │ ├── SwitchInlineQueryChosenChat.cs │ │ │ │ ├── TextQuote.cs │ │ │ │ ├── UniqueGift.cs │ │ │ │ ├── UniqueGiftBackdrop.cs │ │ │ │ ├── UniqueGiftBackdropColors.cs │ │ │ │ ├── UniqueGiftColors.cs │ │ │ │ ├── UniqueGiftInfo.cs │ │ │ │ ├── UniqueGiftModel.cs │ │ │ │ ├── UniqueGiftSymbol.cs │ │ │ │ ├── User.cs │ │ │ │ ├── UserChatBoosts.cs │ │ │ │ ├── UserProfileAudios.cs │ │ │ │ ├── UserProfilePhotos.cs │ │ │ │ ├── UserRating.cs │ │ │ │ ├── UsersShared.cs │ │ │ │ ├── Venue.cs │ │ │ │ ├── Video.cs │ │ │ │ ├── VideoChatEnded.cs │ │ │ │ ├── VideoChatParticipantsInvited.cs │ │ │ │ ├── VideoChatScheduled.cs │ │ │ │ ├── VideoChatStarted.cs │ │ │ │ ├── VideoNote.cs │ │ │ │ ├── VideoQuality.cs │ │ │ │ ├── Voice.cs │ │ │ │ ├── WebAppData.cs │ │ │ │ ├── WebAppInfo.cs │ │ │ │ └── WriteAccessAllowed.cs │ │ │ ├── BotRequestException.cs │ │ │ ├── BotResponse.cs │ │ │ ├── Constants/ │ │ │ │ ├── ChatActions.cs │ │ │ │ ├── ChatTypes.cs │ │ │ │ ├── FormatStyles.cs │ │ │ │ ├── InlineKeyboardButtonTypes.cs │ │ │ │ ├── MessageEntityTypes.cs │ │ │ │ ├── PollTypes.cs │ │ │ │ ├── Stickers/ │ │ │ │ │ ├── StickerFormats.cs │ │ │ │ │ └── StickerTypes.cs │ │ │ │ └── UpdateTypes.cs │ │ │ ├── Converters/ │ │ │ │ ├── BackgroundFillConverter.cs │ │ │ │ ├── BackgroundTypeConverter.cs │ │ │ │ ├── BotCommandScopeConverter.cs │ │ │ │ ├── ChatBoostSourceConverter.cs │ │ │ │ ├── ChatMemberConverter.cs │ │ │ │ ├── DiscriminatorJsonConverter.cs │ │ │ │ ├── InlineQueryResultConverter.cs │ │ │ │ ├── InputMediaConverter.cs │ │ │ │ ├── InputMessageContentConverter.cs │ │ │ │ ├── InputPaidMediaConverter.cs │ │ │ │ ├── InputProfilePhotoConverter.cs │ │ │ │ ├── InputStoryContentConverter.cs │ │ │ │ ├── MaybeInaccessibleMessageConverter.cs │ │ │ │ ├── MenuButtonConverter.cs │ │ │ │ ├── MessageOriginConverter.cs │ │ │ │ ├── OwnedGiftConverter.cs │ │ │ │ ├── PaidMediaConverter.cs │ │ │ │ ├── PassportElementErrorConverter.cs │ │ │ │ ├── ReactionTypeConverter.cs │ │ │ │ ├── ReplyMarkupConverter.cs │ │ │ │ ├── RevenueWithdrawalStateConverter.cs │ │ │ │ ├── StoryAreaTypeConverter.cs │ │ │ │ └── TransactionPartnerConverter.cs │ │ │ ├── Games/ │ │ │ │ ├── Args/ │ │ │ │ │ ├── SendGameArgs.cs │ │ │ │ │ └── SetGameScoreArgs.cs │ │ │ │ ├── CallbackGame.cs │ │ │ │ ├── Game.cs │ │ │ │ ├── GameHighScore.cs │ │ │ │ ├── getGameHighScores.cs │ │ │ │ ├── sendGame.cs │ │ │ │ └── setGameScore.cs │ │ │ ├── GettingUpdates/ │ │ │ │ ├── Args/ │ │ │ │ │ ├── GetUpdatesArgs.cs │ │ │ │ │ └── SetWebhookArgs.cs │ │ │ │ ├── Update.cs │ │ │ │ ├── WebhookInfo.cs │ │ │ │ ├── deleteWebhook.cs │ │ │ │ ├── getUpdates.cs │ │ │ │ ├── getWebhookInfo.cs │ │ │ │ └── setWebhook.cs │ │ │ ├── InlineMode/ │ │ │ │ ├── Args/ │ │ │ │ │ └── AnswerInlineQueryArgs.cs │ │ │ │ ├── ChosenInlineResult.cs │ │ │ │ ├── InlineQuery.cs │ │ │ │ ├── InlineQueryResult/ │ │ │ │ │ ├── InlineQueryResult.cs │ │ │ │ │ ├── InlineQueryResultArticle.cs │ │ │ │ │ ├── InlineQueryResultAudio.cs │ │ │ │ │ ├── InlineQueryResultCachedAudio.cs │ │ │ │ │ ├── InlineQueryResultCachedDocument.cs │ │ │ │ │ ├── InlineQueryResultCachedGif.cs │ │ │ │ │ ├── InlineQueryResultCachedMpeg4Gif.cs │ │ │ │ │ ├── InlineQueryResultCachedPhoto.cs │ │ │ │ │ ├── InlineQueryResultCachedSticker.cs │ │ │ │ │ ├── InlineQueryResultCachedVideo.cs │ │ │ │ │ ├── InlineQueryResultCachedVoice.cs │ │ │ │ │ ├── InlineQueryResultContact.cs │ │ │ │ │ ├── InlineQueryResultDocument.cs │ │ │ │ │ ├── InlineQueryResultGame.cs │ │ │ │ │ ├── InlineQueryResultGif.cs │ │ │ │ │ ├── InlineQueryResultLocation.cs │ │ │ │ │ ├── InlineQueryResultMpeg4Gif.cs │ │ │ │ │ ├── InlineQueryResultPhoto.cs │ │ │ │ │ ├── InlineQueryResultVenue.cs │ │ │ │ │ ├── InlineQueryResultVideo.cs │ │ │ │ │ └── InlineQueryResultVoice.cs │ │ │ │ ├── InlineQueryResultsButton.cs │ │ │ │ ├── InputMessageContent/ │ │ │ │ │ ├── InputContactMessageContent.cs │ │ │ │ │ ├── InputInvoiceMessageContent.cs │ │ │ │ │ ├── InputLocationMessageContent.cs │ │ │ │ │ ├── InputMessageContent.cs │ │ │ │ │ ├── InputTextMessageContent.cs │ │ │ │ │ └── InputVenueMessageContent.cs │ │ │ │ └── answerInlineQuery.cs │ │ │ ├── MethodNames.cs │ │ │ ├── Payments/ │ │ │ │ ├── AffiliateInfo.cs │ │ │ │ ├── Args/ │ │ │ │ │ ├── AnswerShippingQueryArgs.cs │ │ │ │ │ ├── CreateInvoiceLinkArgs.cs │ │ │ │ │ └── SendInvoiceArgs.cs │ │ │ │ ├── Invoice.cs │ │ │ │ ├── LabeledPrice.cs │ │ │ │ ├── OrderInfo.cs │ │ │ │ ├── PaidMediaPurchased.cs │ │ │ │ ├── PreCheckoutQuery.cs │ │ │ │ ├── RefundedPayment.cs │ │ │ │ ├── RevenueWithdrawalState/ │ │ │ │ │ ├── RevenueWithdrawalState.cs │ │ │ │ │ ├── RevenueWithdrawalStateFailed.cs │ │ │ │ │ ├── RevenueWithdrawalStatePending.cs │ │ │ │ │ └── RevenueWithdrawalStateSucceeded.cs │ │ │ │ ├── ShippingAddress.cs │ │ │ │ ├── ShippingOption.cs │ │ │ │ ├── ShippingQuery.cs │ │ │ │ ├── StarTransaction.cs │ │ │ │ ├── StarTransactions.cs │ │ │ │ ├── SuccessfulPayment.cs │ │ │ │ ├── TransactionPartner/ │ │ │ │ │ ├── TransactionPartner.cs │ │ │ │ │ ├── TransactionPartnerAffiliateProgram.cs │ │ │ │ │ ├── TransactionPartnerChat.cs │ │ │ │ │ ├── TransactionPartnerFragment.cs │ │ │ │ │ ├── TransactionPartnerOther.cs │ │ │ │ │ ├── TransactionPartnerTelegramAds.cs │ │ │ │ │ ├── TransactionPartnerTelegramApi.cs │ │ │ │ │ └── TransactionPartnerUser.cs │ │ │ │ ├── answerPreCheckoutQuery.cs │ │ │ │ ├── answerShippingQuery.cs │ │ │ │ ├── createInvoiceLink.cs │ │ │ │ ├── editUserStarSubscription.cs │ │ │ │ ├── getMyStarBalance.cs │ │ │ │ ├── getStarTransactions.cs │ │ │ │ ├── refundStarPayment.cs │ │ │ │ └── sendInvoice.cs │ │ │ ├── PropertyNames.cs │ │ │ ├── README.md │ │ │ ├── Stickers/ │ │ │ │ ├── Args/ │ │ │ │ │ ├── AddStickerToSetArgs.cs │ │ │ │ │ ├── CreateNewStickerSetArgs.cs │ │ │ │ │ ├── GetCustomEmojiStickersArgs.cs │ │ │ │ │ ├── ReplaceStickerInSetArgs.cs │ │ │ │ │ ├── SendGiftArgs.cs │ │ │ │ │ ├── SendStickerArgs.cs │ │ │ │ │ ├── SetStickerEmojiListArgs.cs │ │ │ │ │ ├── SetStickerKeywordsArgs.cs │ │ │ │ │ ├── SetStickerMaskPositionArgs.cs │ │ │ │ │ ├── SetStickerSetThumbnailArgs.cs │ │ │ │ │ └── UploadStickerFileArgs.cs │ │ │ │ ├── Gift.cs │ │ │ │ ├── Gifts.cs │ │ │ │ ├── InputSticker.cs │ │ │ │ ├── MaskPosition.cs │ │ │ │ ├── Sticker.cs │ │ │ │ ├── StickerSet.cs │ │ │ │ ├── addStickerToSet.cs │ │ │ │ ├── createNewStickerSet.cs │ │ │ │ ├── deleteStickerFromSet.cs │ │ │ │ ├── deleteStickerSet.cs │ │ │ │ ├── getAvailableGifts.cs │ │ │ │ ├── getCustomEmojiStickers.cs │ │ │ │ ├── getStickerSet.cs │ │ │ │ ├── removeChatVerification.cs │ │ │ │ ├── removeUserVerification.cs │ │ │ │ ├── replaceStickerInSet.cs │ │ │ │ ├── sendGift.cs │ │ │ │ ├── sendSticker.cs │ │ │ │ ├── setCustomEmojiStickerSetThumbnail.cs │ │ │ │ ├── setStickerEmojiList.cs │ │ │ │ ├── setStickerKeywords.cs │ │ │ │ ├── setStickerMaskPosition.cs │ │ │ │ ├── setStickerPositionInSet.cs │ │ │ │ ├── setStickerSetThumbnail.cs │ │ │ │ ├── setStickerSetTitle.cs │ │ │ │ ├── uploadStickerFile.cs │ │ │ │ ├── verifyChat.cs │ │ │ │ └── verifyUser.cs │ │ │ ├── Telegram.BotAPI.csproj │ │ │ ├── TelegramBotClient.API.cs │ │ │ ├── TelegramBotClient.ITelegramBotClient.cs │ │ │ ├── TelegramBotClient.cs │ │ │ ├── TelegramBotClientOptions.cs │ │ │ ├── TelegramConstants.cs │ │ │ ├── TelegramPassport/ │ │ │ │ ├── Args/ │ │ │ │ │ └── SetPassportDataErrorsArgs.cs │ │ │ │ ├── EncryptedCredentials.cs │ │ │ │ ├── EncryptedPassportElement.cs │ │ │ │ ├── PassportData.cs │ │ │ │ ├── PassportElementError/ │ │ │ │ │ ├── PassportElementError.cs │ │ │ │ │ ├── PassportElementErrorDataField.cs │ │ │ │ │ ├── PassportElementErrorFile.cs │ │ │ │ │ ├── PassportElementErrorFiles.cs │ │ │ │ │ ├── PassportElementErrorFrontSide.cs │ │ │ │ │ ├── PassportElementErrorReverseSide.cs │ │ │ │ │ ├── PassportElementErrorSelfie.cs │ │ │ │ │ ├── PassportElementErrorTranslationFile.cs │ │ │ │ │ ├── PassportElementErrorTranslationFiles.cs │ │ │ │ │ └── PassportElementErrorUnspecified.cs │ │ │ │ ├── PassportFile.cs │ │ │ │ └── setPassportDataErrors.cs │ │ │ ├── UpdatingMessages/ │ │ │ │ ├── Args/ │ │ │ │ │ ├── DeleteBusinessMessagesArgs.cs │ │ │ │ │ ├── DeleteMessagesArgs.cs │ │ │ │ │ ├── EditMessageCaptionArgs.cs │ │ │ │ │ ├── EditMessageChecklistArgs.cs │ │ │ │ │ ├── EditMessageLiveLocationArgs.cs │ │ │ │ │ ├── EditMessageMediaArgs.cs │ │ │ │ │ ├── EditMessageReplyMarkupArgs.cs │ │ │ │ │ ├── EditMessageTextArgs.cs │ │ │ │ │ ├── EditStoryArgs.cs │ │ │ │ │ ├── GetBusinessAccountGiftsArgs.cs │ │ │ │ │ ├── GiftPremiumSubscriptionArgs.cs │ │ │ │ │ ├── PostStoryArgs.cs │ │ │ │ │ ├── SendGiftArgs.cs │ │ │ │ │ ├── SetBusinessAccountGiftSettingsArgs.cs │ │ │ │ │ ├── SetBusinessAccountProfilePhotoArgs.cs │ │ │ │ │ ├── StopMessageLiveLocationArgs.cs │ │ │ │ │ └── StopPollArgs.cs │ │ │ │ ├── approveSuggestedPost.cs │ │ │ │ ├── convertGiftToStars.cs │ │ │ │ ├── declineSuggestedPost.cs │ │ │ │ ├── deleteAllMessageReactions.cs │ │ │ │ ├── deleteBusinessMessages.cs │ │ │ │ ├── deleteMessage.cs │ │ │ │ ├── deleteMessageReaction.cs │ │ │ │ ├── deleteMessages.cs │ │ │ │ ├── deleteStory.cs │ │ │ │ ├── editMessageCaption.cs │ │ │ │ ├── editMessageChecklist.cs │ │ │ │ ├── editMessageLiveLocation.cs │ │ │ │ ├── editMessageMedia.cs │ │ │ │ ├── editMessageReplyMarkup.cs │ │ │ │ ├── editMessageText.cs │ │ │ │ ├── editStory.cs │ │ │ │ ├── getAvailableGifts.cs │ │ │ │ ├── getBusinessAccountGifts.cs │ │ │ │ ├── getBusinessAccountStarBalance.cs │ │ │ │ ├── giftPremiumSubscription.cs │ │ │ │ ├── postStory.cs │ │ │ │ ├── readBusinessMessage.cs │ │ │ │ ├── removeBusinessAccountProfilePhoto.cs │ │ │ │ ├── removeChatVerification.cs │ │ │ │ ├── removeUserVerification.cs │ │ │ │ ├── sendGift.cs │ │ │ │ ├── setBusinessAccountBio.cs │ │ │ │ ├── setBusinessAccountGiftSettings.cs │ │ │ │ ├── setBusinessAccountName.cs │ │ │ │ ├── setBusinessAccountProfilePhoto.cs │ │ │ │ ├── setBusinessAccountUsername.cs │ │ │ │ ├── stopMessageLiveLocation.cs │ │ │ │ ├── stopPoll.cs │ │ │ │ ├── transferBusinessAccountStars.cs │ │ │ │ ├── transferGift.cs │ │ │ │ ├── upgradeGift.cs │ │ │ │ ├── verifyChat.cs │ │ │ │ └── verifyUser.cs │ │ │ └── Usings.cs │ │ └── Telegram.BotAPI.Extensions/ │ │ ├── Builders/ │ │ │ ├── AppendButtonOptions.cs │ │ │ ├── InlineKeyboardBuilder.cs │ │ │ ├── KeyboardBuilderBase.cs │ │ │ └── ReplyKeyboardBuilder.cs │ │ ├── Commands/ │ │ │ ├── BotCommandAttribute.cs │ │ │ ├── BotCommandParser.cs │ │ │ ├── BotCommandVisibility.cs │ │ │ ├── BotCommandVisibilityAttribute.cs │ │ │ └── LocalizedBotCommandAttribute.cs │ │ ├── HtmlTextFormatter.cs │ │ ├── IAsyncUpdateHandler.cs │ │ ├── IUpdateHandler.cs │ │ ├── LongPolling/ │ │ │ ├── LongPollingExtensions.cs │ │ │ └── LongPollingOptions.cs │ │ ├── README.md │ │ ├── SimpleUpdateHandlerBase.cs │ │ ├── Telegram.BotAPI.Extensions.csproj │ │ ├── TelegramBotClientExtensions.cs │ │ └── UpdateExtensions.cs │ └── tests/ │ └── Telegram.BotAPI.Tests/ │ ├── Args.cs │ ├── CommandParserTests.cs │ ├── ConverterTests.cs │ ├── ExtensionsTests.cs │ ├── MethodTests.cs │ ├── Serialization.cs │ ├── Telegram.BotAPI.Tests.csproj │ └── Usings.cs └── tools/ ├── .editorconfig ├── .vscode/ │ ├── launch.json │ └── settings.json ├── README.md ├── constants.csx ├── generator.csx ├── main.csx ├── mapper.csx ├── models.csx ├── omnisharp.json └── scrapper.csx ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitattributes ================================================ # Auto detect text files and perform LF normalization * text=auto ================================================ FILE: .github/workflows/build.yaml ================================================ name: Build & Test on: push: branches: - main - dev pull_request: branches: - main - dev jobs: build: runs-on: ubuntu-latest defaults: run: working-directory: ./src steps: - uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore - name: Build run: dotnet build --no-restore -c Release - name: Test run: dotnet test -c Release --no-build --verbosity normal ================================================ FILE: .github/workflows/close-inactive-issues.yaml ================================================ # This workflow will close issues that have been inactive for 60 days name: Close inactive issues on: schedule: - cron: "30 1 * * *" jobs: # Close issues that have been inactive for 60 days close-issues: runs-on: ubuntu-latest permissions: issues: write pull-requests: write steps: - uses: actions/stale@v5 with: days-before-issue-stale: -1 days-before-issue-close: 60 close-issue-message: "This issue was closed because it has been open for 60 days with no activity being marked as stale." days-before-pr-stale: -1 days-before-pr-close: -1 repo-token: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: .github/workflows/publish.yaml ================================================ name: Publish on: release: types: [published] workflow_dispatch: jobs: publish: name: build, pack & publish runs-on: ubuntu-latest defaults: run: working-directory: ./src steps: - uses: actions/checkout@v6 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore - name: Build run: dotnet build -c Release - name: Test run: dotnet test -c Release --no-build --verbosity normal - name: Pack run: dotnet pack -c Release -o ./nupkgs --no-build - name: Publish env: NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_TOKEN }} run: dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ env.NUGET_AUTH_TOKEN }} --skip-duplicate -s https://api.nuget.org/v3/index.json ================================================ FILE: .gitignore ================================================ # Ignore vscode editor files .vscode/* # Ignore all folders named publish **/publish/* # Nuget packages nuget.config ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2020-2025 Quetzal Rivera Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ | Logo |

Telegram.BotAPI

| | -------------------------------------------------- | ------------------------ | [![NuGet version (Telegram.BotAPI)](https://img.shields.io/nuget/v/Telegram.BotAPI?style=flat-square&logo=nuget)](https://www.nuget.org/packages/Telegram.BotAPI/) [![Compatible with Bot API v10.0](https://img.shields.io/badge/Bot%20API%20version-v10.0-blue?style=flat-square)](https://core.telegram.org/bots/api#april-3-2026) **Telegram.BotAPI** is one of the most complete libraries available to interact with the Telegram Bot API in your .NET projects. It contains all the methods and types available in the Bot API 10.0 released on May 8, 2026. [![Telegram Chat](https://img.shields.io/badge/Telegram.BotAPI%20--%20Chat-Join-blue?style=social&logo=telegram)](https://t.me/TBAPINET) --- ## Features - Contains pre-defined methods for all Bot API 10.0 methods. - Contains classes for each object type used in the Bot API 10.0. - Sync and async methods. - Uses [System.Text.Json](https://www.nuget.org/packages/System.Text.Json/). --- ## .NET platforms support - NET Standard >= 2.0 - NET Core >= 2.0, .NET 6, .NET 8 - NET Framework >= 4.6.2 - Universal Windows Platform >= 10.0.16299 - Unity >= 2018.1 --- ## Installation ### Install from the command line ```PowerShell dotnet add PROJECT package Telegram.BotAPI ``` [Get package from Nuget Web Site](https://www.nuget.org/packages/Telegram.BotAPI/) --- ## How to use First, get your **bot token** from [BotFather](https://t.me/BotFather) and use it to create a new instance of `Telegram.BotAPI.TelegramBotClient` as follows. ```CSharp using Telegram.BotAPI; var botToken = "bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"; // You need a TelegramBotClient instance if you want access to the Bot API methods. var client = new TelegramBotClient(botToken); ``` The methods and types are organized in namespaces according to their corresponding section on the [Official Bot API website](https://core.telegram.org/bots/api). So if you want to use a method or type, you must first include the corresponding namespace. Currently the following namespaces are available: | Name | Description | | :------------------------------- | :------------------------------------------------- | | Telegram.BotAPI | Contains the TelegramBotClient and other utilities | | Telegram.BotAPI.GettingUpdates | Contains methods and types for getting updates | | Telegram.BotAPI.AvailableTypes | Contains available types | | Telegram.BotAPI.AvailableMethods | Contains available methods | | Telegram.BotAPI.UpdatingMessages | Contains methods and types for updating messages | | Telegram.BotAPI.Stickers | Contains methods and types for stickers | | Telegram.BotAPI.InlineMode | Contains methods and types for inline mode | | Telegram.BotAPI.Payments | Contains methods and types for payments | | Telegram.BotAPI.TelegramPassport | Contains methods and types for Telegram Passport | | Telegram.BotAPI.Games | Contains methods and types for games | Once the namespaces are included, you are ready to start managing your bot. For example, you can use the [getMe](https://core.telegram.org/bots/api#getme) method to get basic information about your bot. ```CSharp using Telegram.BotAPI.AvailableMethods; var me = client.GetMe(); Console.WriteLine("My name is {0}.", me.FirstName); ``` ## Getting updates Every time a user interacts with a bot, bot will receive a new update. Updates contain information about user events, such as a new message or when a button is clicked. If you want your bot to reply to a message, then your bot must be able to get updates first. Currently, there are two ways to get updates: [Long Polling](#long-polling) and [webhooks](#webhooks). ### Long Polling To get updates using **Long Polling**, you must create a perpetual loop and check for updates using the getUpdates method. After all updates have been processed, you must mark them as read by setting the offset parameter to a value greater than the id of the last update. See the follow example: ```CSharp using System.Linq; using Telegram.BotAPI.GettingUpdates; var updates = client.GetUpdates(); while (true) { if (updates.Any()) { foreach (var update in updates) { // Process update } var offset = updates.Last().UpdateId + 1; updates = client.GetUpdates(offset); } else { updates = client.GetUpdates(); } } ``` ### Webhooks To receive updates through webhook, you must create a web application. In your ASP NET application, create a new api controller for your bot and define a function to receive the update as shown below. ```CSharp using Telegram.BotAPI.GettingUpdates; [HttpPost] public IActionResult Post( // The secret token is optional, but it's highly recommended to use it. [FromHeader(Name = "X-Telegram-Bot-Api-Secret-Token")] string secretToken, [FromBody] Update update) { if (update is null) { return BadRequest(); } // Check if the secret token is valid // Process your update return Ok(); } ``` At the beginning of your application, you need to register your webhook using the API. In this way, Telegram will send new updates to your API controller. See the example below: ```CSharp api.DeleteWebhook(true); // Delete old webhook api.SetWebhook("https://example.com/"); // Set new webhook ``` > It's high recommended to configurate a secret token to access the api controller through the setWebhook method. This will prevent third parties from accessing your api controller. > Using a webhook will disable the `getUpdates` method. Use `deleteWebhook` to enable it again. ## Sending messages Sending messages is the simplest and most important task of a bot. See the following example for sending text messages. ```CSharp using Telegram.BotAPI.AvailableMethods; long chatId = update.Message.Chat.Id; // Target chat Id api.SendMessage(chatId, "Hello World!"); // Send a message ``` Your bot can also send multimedia messages like photos, gifs, videos, and others. See [Available methods](https://core.telegram.org/bots/api#available-methods) for learn more. ## Uploading files You can also send attached files using InputFile objects. You have two ways to do it: By using an InputFile object directly or by using a dictionary of InputFile objects. ### Option 1 ```CSharp using Telegram.BotAPI; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.AvailableMethods; var file = new InputFile(filebytes, "file.zip"); // Upload document api.SendDocument(chatId, file); ``` ### Option 2 ```CSharp using Telegram.BotAPI; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.AvailableMethods; var file = new InputFile(filebytes, "file.zip"); var files = new Dictionary() { { "file56", file } }; // Upload document api.SendDocument(chatId, "attach://file56", files: files); ``` ## Making custom requests The library already includes all types and methods available in the Bot API. However, if you want to use your own types or if you want to be the first one to use new features when they are released, you can use the `CallMethod` and/or `CallMethodDirect` methods defined in the ITelegramBotClient instance. ```CSharp var args = new Dictionary() { { "chat_id", 123456789 }, { "text", "Hello World!" } }; // Message is the type you want to use to deserialize the response result. It can be an in-built type or a custom type created by you. var message = client.CallMethod("sendMessage", args); ``` The previous method is used by all extension methods defined in the library. You can also create your own extension methods to make custom requests if you want. ```CSharp public static class TelegramBotClientExtensions { public static Message SendHelloWorld(this ITelegramBotClient client, long chatId) { var args = new Dictionary() { { "chat_id", chatId }, { "text", "Hello World!" } }; return client.CallMethod("sendMessage", args); } } ``` The library also includes the classes `MethodNames` and `PropertyNames` that contain the names of all methods and properties. The `CallMethod` will trigger an exception if the response status code is not OK. If you don't like this behavior, you can use the `CallMethodDirect` method instead. ```CSharp var args = new Dictionary() { { "chat_id", 123456789 }, { "text", "Hello World!" } }; // BotResponse var response = client.CallMethodDirect("sendMessage", args); ``` You'll get a `BotResponse` object as a response. This object contains the status code, the deserialized result or null (if error), the error description and also some error parameters if available. --- ## Examples You can see more examples [here](https://github.com/Eptagone/Telegram.BotAPI/tree/main/src/Telegram.BotAPI.Examples). ## License [MIT](https://github.com/Eptagone/Telegram.BotAPI/blob/main/LICENSE) ## Release notes [See release notes](https://github.com/Eptagone/Telegram.BotAPI/releases) # Support this project If you wish, you can donate through the following methods: - [Buy me a cookie](https://www.buymeacoffee.com/eptagone) - TON: [UQBRpyQ2pUOngdVr5HW8KQ7G8CToGS4o0WFAtUb3bQx4lt_0](ton://transfer/UQBRpyQ2pUOngdVr5HW8KQ7G8CToGS4o0WFAtUb3bQx4lt_0) ================================================ FILE: src/.editorconfig ================================================ [*.cs] csharp_indent_braces = false insert_final_newline = true dotnet_diagnostic.ca1200.severity = suggestion dotnet_diagnostic.ca1805.severity = suggestion dotnet_diagnostic.cs8766.severity = silent csharp_using_directive_placement = outside_namespace:silent csharp_prefer_simple_using_statement = true:suggestion csharp_prefer_braces = true:silent csharp_style_namespace_declarations = file_scoped:suggestion csharp_style_prefer_method_group_conversion = true:silent csharp_style_prefer_top_level_statements = true:silent csharp_style_expression_bodied_methods = true:none csharp_style_expression_bodied_constructors = true:none csharp_style_expression_bodied_operators = false:silent csharp_style_expression_bodied_properties = true:silent csharp_style_expression_bodied_indexers = true:silent csharp_style_expression_bodied_accessors = true:silent csharp_style_expression_bodied_lambdas = true:silent csharp_style_expression_bodied_local_functions = false:silent csharp_indent_labels = one_less_than_current csharp_style_throw_expression = true:suggestion csharp_style_prefer_null_check_over_type_check = true:suggestion csharp_prefer_simple_default_expression = true:suggestion csharp_style_prefer_local_over_anonymous_function = true:suggestion csharp_style_prefer_index_operator = true:suggestion csharp_style_prefer_range_operator = true:suggestion csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion csharp_style_prefer_tuple_swap = true:suggestion csharp_style_prefer_utf8_string_literals = true:suggestion csharp_style_inlined_variable_declaration = true:suggestion csharp_style_deconstructed_variable_declaration = true:suggestion csharp_style_unused_value_assignment_preference = discard_variable:suggestion csharp_style_unused_value_expression_statement_preference = discard_variable:silent csharp_space_around_binary_operators = before_and_after csharp_prefer_static_local_function = true:suggestion csharp_style_prefer_readonly_struct = true:suggestion csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent csharp_style_conditional_delegate_call = true:suggestion csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion csharp_style_prefer_pattern_matching = true:silent csharp_style_prefer_switch_expression = true:suggestion csharp_style_var_for_built_in_types = false:silent csharp_style_prefer_extended_property_pattern = true:suggestion csharp_style_prefer_not_pattern = true:suggestion csharp_style_pattern_matching_over_as_with_null_check = true:suggestion csharp_style_var_when_type_is_apparent = false:silent csharp_style_var_elsewhere = false:silent csharp_style_prefer_primary_constructors = true:suggestion csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent # ReSharper properties resharper_local_function_body = expression_body [*.{cs,vb}] dotnet_diagnostic.ca1707.severity = suggestion dotnet_diagnostic.ca1710.severity = silent dotnet_diagnostic.ca1713.severity = suggestion dotnet_diagnostic.ca1727.severity = warning [*.{cs,vb}] #### Naming styles #### # Naming rules dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion dotnet_naming_rule.types_should_be_pascal_case.symbols = types dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case # Symbol specifications dotnet_naming_symbols.interface.applicable_kinds = interface dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_symbols.interface.required_modifiers = dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_symbols.types.required_modifiers = dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_symbols.non_field_members.required_modifiers = # Naming styles dotnet_naming_style.begins_with_i.required_prefix = I dotnet_naming_style.begins_with_i.required_suffix = dotnet_naming_style.begins_with_i.word_separator = dotnet_naming_style.begins_with_i.capitalization = pascal_case dotnet_naming_style.pascal_case.required_prefix = dotnet_naming_style.pascal_case.required_suffix = dotnet_naming_style.pascal_case.word_separator = dotnet_naming_style.pascal_case.capitalization = pascal_case dotnet_naming_style.pascal_case.required_prefix = dotnet_naming_style.pascal_case.required_suffix = dotnet_naming_style.pascal_case.word_separator = dotnet_naming_style.pascal_case.capitalization = pascal_case dotnet_style_coalesce_expression = true:suggestion dotnet_style_null_propagation = true:suggestion dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion dotnet_style_prefer_auto_properties = true:silent dotnet_style_object_initializer = true:suggestion dotnet_style_operator_placement_when_wrapping = beginning_of_line tab_width = 4 indent_size = 4 end_of_line = lf dotnet_style_collection_initializer = true:suggestion dotnet_style_qualification_for_field = true:suggestion dotnet_style_qualification_for_property = true:suggestion dotnet_style_qualification_for_method = true:suggestion dotnet_style_qualification_for_event = true:suggestion dotnet_style_prefer_simplified_boolean_expressions = true:suggestion dotnet_style_prefer_conditional_expression_over_assignment = true:silent dotnet_style_prefer_conditional_expression_over_return = true:silent dotnet_style_explicit_tuple_names = true:suggestion dotnet_style_prefer_inferred_tuple_names = true:suggestion dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion dotnet_style_prefer_compound_assignment = true:suggestion dotnet_style_prefer_simplified_interpolation = true:suggestion dotnet_style_namespace_match_folder = true:suggestion dotnet_style_readonly_field = true:suggestion dotnet_style_predefined_type_for_locals_parameters_members = true:silent dotnet_style_predefined_type_for_member_access = true:silent dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent dotnet_style_allow_multiple_blank_lines_experimental = true:silent dotnet_style_allow_statement_immediately_after_block_experimental = true:silent dotnet_code_quality_unused_parameters = all:suggestion dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent # Extra rules file_header_template = Copyright (c) 2026 Quetzal Rivera.\nLicensed under the MIT License, See LICENCE in the project root for license information. indent_style = space ================================================ FILE: src/.gitignore ================================================ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore # User-specific files *.rsuser *.suo *.user *.userosscache *.sln.docstates # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs # Mono auto generated files mono_crash.* # Build results [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ x64/ x86/ [Ww][Ii][Nn]32/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ [Ll]ogs/ # Visual Studio 2015/2017 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ # Visual Studio 2017 auto generated files Generated\ Files/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* # NUnit *.VisualState.xml TestResult.xml nunit-*.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c # Benchmark Results BenchmarkDotNet.Artifacts/ # .NET Core project.lock.json project.fragment.lock.json artifacts/ # ASP.NET Scaffolding ScaffoldingReadMe.txt # StyleCop StyleCopReport.xml # Files built by Visual Studio *_i.c *_p.c *_h.h *.ilk *.meta *.obj *.iobj *.pch *.pdb *.ipdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *_wpftmp.csproj *.log *.tlog *.vspscc *.vssscc .builds *.pidb *.svclog *.scc # Chutzpah Test files _Chutzpah* # Visual C++ cache files ipch/ *.aps *.ncb *.opendb *.opensdf *.sdf *.cachefile *.VC.db *.VC.VC.opendb # Visual Studio profiler *.psess *.vsp *.vspx *.sap # Visual Studio Trace Files *.e2e # TFS 2012 Local Workspace $tf/ # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # AxoCover is a Code Coverage Tool .axoCover/* !.axoCover/settings.json # Coverlet is a free, cross platform Code Coverage Tool coverage*.json coverage*.xml coverage*.info # Visual Studio code coverage results *.coverage *.coveragexml # NCrunch _NCrunch_* .*crunch*.local.xml nCrunchTemp_* # MightyMoose *.mm.* AutoTest.Net/ # Web workbench (sass) .sass-cache/ # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml # Note: Comment the next line if you want to checkin your web deploy settings, # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to # checkin your Azure Web App publish settings, but sensitive information contained # in these scripts will be unencrypted PublishScripts/ # NuGet Packages *.nupkg # NuGet Symbol Packages *.snupkg # The packages folder can be ignored because of Package Restore **/[Pp]ackages/* # except build/, which is used as an MSBuild target. !**/[Pp]ackages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/[Pp]ackages/repositories.config # NuGet v3's project.json files produces more ignorable files *.nuget.props *.nuget.targets # Microsoft Azure Build Output csx/ *.build.csdef # Microsoft Azure Emulator ecf/ rcf/ # Windows Store app package directories and files AppPackages/ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt *.appx *.appxbundle *.appxupload # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache !?*.[Cc]ache/ # Others ClientBin/ ~$* *~ *.dbmdl *.dbproj.schemaview *.jfm *.pfx *.publishsettings orleans.codegen.cs # Including strong name files can present a security risk # (https://github.com/github/gitignore/pull/2483#issue-259490424) #*.snk # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file # to a newer Visual Studio version. Backup files are not needed, # because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm ServiceFabricBackup/ *.rptproj.bak # SQL Server files *.mdf *.ldf *.ndf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings *.rptproj.rsuser *- [Bb]ackup.rdl *- [Bb]ackup ([0-9]).rdl *- [Bb]ackup ([0-9][0-9]).rdl # Microsoft Fakes FakesAssemblies/ # GhostDoc plugin setting file *.GhostDoc.xml # Node.js Tools for Visual Studio .ntvs_analysis.dat node_modules/ # Visual Studio 6 build log *.plg # Visual Studio 6 workspace options file *.opt # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) *.vbw # Visual Studio 6 auto-generated project file (contains which files were open etc.) *.vbp # Visual Studio 6 workspace and project file (working project files containing files to include in project) *.dsw *.dsp # Visual Studio 6 technical files *.ncb *.aps # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts **/*.DesktopClient/ModelManifest.xml **/*.Server/GeneratedArtifacts **/*.Server/ModelManifest.xml _Pvt_Extensions # Paket dependency manager .paket/paket.exe paket-files/ # FAKE - F# Make .fake/ # CodeRush personal settings .cr/personal # Python Tools for Visual Studio (PTVS) __pycache__/ *.pyc # Cake - Uncomment if you are using it # tools/** # !tools/packages.config # Tabs Studio *.tss # Telerik's JustMock configuration file *.jmconfig # BizTalk build output *.btp.cs *.btm.cs *.odx.cs *.xsd.cs # OpenCover UI analysis results OpenCover/ # Azure Stream Analytics local run output ASALocalRun/ # MSBuild Binary and Structured Log *.binlog # NVidia Nsight GPU debugger configuration file *.nvuser # MFractors (Xamarin productivity tool) working folder .mfractor/ # Local History for Visual Studio .localhistory/ # Visual Studio History (VSHistory) files .vshistory/ # BeatPulse healthcheck temp database healthchecksdb # Backup folder for Package Reference Convert tool in Visual Studio 2017 MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ # Fody - auto-generated XML schema FodyWeavers.xsd # VS Code files for those working on multiple tools .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json *.code-workspace # Local History for Visual Studio Code .history/ # Windows Installer files from build outputs *.cab *.msi *.msix *.msm *.msp # JetBrains Rider *.sln.iml .idea ================================================ FILE: src/Telegram.BotAPI.sln ================================================  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Telegram.BotAPI", "library\Telegram.BotAPI\Telegram.BotAPI.csproj", "{333CEF37-B947-47CA-A339-9B14D4D7E20A}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{E90CDF4A-2731-4F91-9BD7-4A40E04DF290}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{576E0D2C-631B-4C68-9AF4-0D99DC4E5951}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Telegram.BotAPI.Tests", "tests\Telegram.BotAPI.Tests\Telegram.BotAPI.Tests.csproj", "{14B3773F-CA9B-4AB7-A799-4CAD7A43D927}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EEFA3271-1A58-4067-B29D-C1B1770C6082}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Telegram.BotAPI.Extensions", "library\Telegram.BotAPI.Extensions\Telegram.BotAPI.Extensions.csproj", "{BA0FF392-07D4-4C31-866B-93865F4E1FF2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {333CEF37-B947-47CA-A339-9B14D4D7E20A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {333CEF37-B947-47CA-A339-9B14D4D7E20A}.Debug|Any CPU.Build.0 = Debug|Any CPU {333CEF37-B947-47CA-A339-9B14D4D7E20A}.Release|Any CPU.ActiveCfg = Release|Any CPU {333CEF37-B947-47CA-A339-9B14D4D7E20A}.Release|Any CPU.Build.0 = Release|Any CPU {14B3773F-CA9B-4AB7-A799-4CAD7A43D927}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {14B3773F-CA9B-4AB7-A799-4CAD7A43D927}.Debug|Any CPU.Build.0 = Debug|Any CPU {14B3773F-CA9B-4AB7-A799-4CAD7A43D927}.Release|Any CPU.ActiveCfg = Release|Any CPU {14B3773F-CA9B-4AB7-A799-4CAD7A43D927}.Release|Any CPU.Build.0 = Release|Any CPU {BA0FF392-07D4-4C31-866B-93865F4E1FF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BA0FF392-07D4-4C31-866B-93865F4E1FF2}.Debug|Any CPU.Build.0 = Debug|Any CPU {BA0FF392-07D4-4C31-866B-93865F4E1FF2}.Release|Any CPU.ActiveCfg = Release|Any CPU {BA0FF392-07D4-4C31-866B-93865F4E1FF2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {333CEF37-B947-47CA-A339-9B14D4D7E20A} = {E90CDF4A-2731-4F91-9BD7-4A40E04DF290} {14B3773F-CA9B-4AB7-A799-4CAD7A43D927} = {576E0D2C-631B-4C68-9AF4-0D99DC4E5951} {BA0FF392-07D4-4C31-866B-93865F4E1FF2} = {E90CDF4A-2731-4F91-9BD7-4A40E04DF290} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {85BE005E-491E-437E-BA2C-2202816F73AF} EndGlobalSection EndGlobal ================================================ FILE: src/examples/.dockerignore ================================================ **/.classpath **/.dockerignore **/.env **/.git **/.gitignore **/.project **/.settings **/.toolstarget **/.vs **/.vscode **/*.*proj.user **/*.dbmdl **/*.jfm **/azds.yaml **/bin **/charts **/docker-compose* **/Dockerfile* **/node_modules **/npm-debug.log **/obj **/secrets.dev.yaml **/values.dev.yaml LICENSE README.md ================================================ FILE: src/examples/BotTemplate/BotTemplateSample.csproj ================================================ Exe net8.0 BotTemplateSample annotations ================================================ FILE: src/examples/BotTemplate/MyBot.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System; using System.Linq; using System.Text.RegularExpressions; using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.Extensions; using Telegram.BotAPI.GettingUpdates; namespace BotTemplateSample { public sealed class MyBot : SimpleUpdateHandlerBase { public static readonly TelegramBotClient Bot = new(""); private static readonly User Me = Bot.GetMe(); public MyBot() { // Provides a better way to extract commands using regular expressions. this.SetCommandExtractor(Me.Username!); } public override void OnUpdate(Update update) { Console.WriteLine( "New update with id: {0}. Type: {1}", update.UpdateId, update.GetUpdateType() ); base.OnUpdate(update); } protected override void OnMessage(Message message) { // Ignore user 777000 (Telegram) if (message.From?.Id == TelegramConstants.TelegramId) { return; } Console.WriteLine("New message from chat id: {0}", message.Chat.Id); Console.WriteLine("Message Text: {0}", message.Text ?? "|:O"); if (message.Chat.Type == ChatTypes.Private) // Private Chats { // Make something } // Group chats // Check if the message contains a command if (message.Entities?.Any(e => e.Type == "bot_command") is not true) { return; } // If the command includes a mention, you should verify that it is for your bot, otherwise you will need to ignore the command. string? pattern = $@"^\/(?\w*)(?:|@{Me.Username})(?:$|\s(?.*))"; Match? match = Regex.Match(message.Text!, pattern, RegexOptions.IgnoreCase); if (!match.Success) { return; } string? command = match.Groups.Values.Single(v => v.Name == "COMMAND").Value; // Get command name string? @params = match.Groups.Values.SingleOrDefault(v => v.Name == "PARAMETERS")?.Value ?? string.Empty; Console.WriteLine("New command: {0}", command); this.OnCommand(message, command, @params); } protected override void OnCommand(Message message, string cmd, string parameters) { string[]? args = parameters.Split(' ', StringSplitOptions.RemoveEmptyEntries); Console.WriteLine("Params: {0}", args.Length); switch (cmd) { case "hello": string? hello = $"Hello World, {message.From?.FirstName}!"; Bot.SendMessage(message.Chat.Id, hello); break; } } protected override void OnException(Exception exp) { if (exp is BotRequestException botException) { Console.WriteLine("New BotException: {0}", botException.Message); Console.WriteLine("Error Code: {0}", botException.ErrorCode); } else { Console.WriteLine("New Exception: {0}", exp.Message); } Console.WriteLine(); } } } ================================================ FILE: src/examples/BotTemplate/Program.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System; using System.Linq; using BotTemplateSample; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.GettingUpdates; Console.WriteLine("Start!"); MyBot.Bot.SetMyCommands([new BotCommand("hello", "Hello World!!")]); MyBot.Bot.DeleteWebhook(); // Long Polling: Start var updates = MyBot.Bot.GetUpdates(); while (true) { if (updates.Any()) { foreach (var update in updates) { var botInstance = new MyBot(); botInstance.OnUpdate(update); } var offset = updates.Last().UpdateId + 1; updates = MyBot.Bot.GetUpdates(offset); } else { updates = MyBot.Bot.GetUpdates(); } } // Long Polling: End ================================================ FILE: src/examples/BotTemplate/readme.md ================================================ # Bot Templace - Sample ## Description .NET Core console app The bot sends "Hello World!" when it receives a message using TelegramBot base class. ## Preview ![hello world gif](/docs/media/samples/BotTemplate.gif) ## Source Code ```CSharp using System; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Linq; using Telegram.BotAPI; using Telegram.BotAPI.GettingUpdates; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.InlineMode; using Telegram.BotAPI.Payments; namespace BotTemplateSample { class Program { static void Main() { Console.WriteLine("Start!"); MyBot.Bot.SetMyCommands(new BotCommand("hello", "Hello World!!")); MyBot.StartPolling(); Console.Read(); } } public sealed class MyBot : TelegramBot { public static TelegramBotClient Bot = new TelegramBotClient(""); public static User Me = Bot.GetMe(); public static void StartPolling() { var updates = Bot.GetUpdates>(); while (true) { if (updates.Any()) { foreach (var update in updates) { var botInstance = new MyBot(); botInstance.OnUpdate(update); } var offset = updates.Last().UpdateId + 1; updates = Bot.GetUpdates>(offset); } else { updates = Bot.GetUpdates>(); } } } // private Message message; private bool hasText; private User appUser; public override void OnMessage(Message message) { // Ignore user 777000 (Telegram) if (message.From.Id == 777000) { return; } Console.WriteLine("New message from chat id: {0}", message.Chat.Id); appUser = message.From; // Save current user; this.message = message; // Save current message; hasText = !string.IsNullOrEmpty(message.Text); // True if message has text; Console.WriteLine("Message Text: {0}", hasText ? message.Text : "|:O"); if (message.Chat.Type == ChatType.Private) // Private Chats { } else // Group chats { } if (hasText) { if (message.Text.StartsWith('/')) // New commands { var splitText = message.Text.Split(' '); var command = splitText.First(); var parameters = splitText.Skip(1).ToArray(); // If the command includes a mention, you should verify that it is for your bot, otherwise you will need to ignore the command. var pattern = string.Format(@"^\/(?\w*)(?:$|@{0}$)", Me.Username); var match = Regex.Match(command, pattern, RegexOptions.IgnoreCase); if (match.Success) { command = match.Groups.Values.Last().Value; // Get command name Console.WriteLine("New command: {0}", command); OnCommand(command, parameters); } } } } private void OnCommand(string cmd, string[] args) { Console.WriteLine("Params: {0}", args.Length); switch (cmd) { case "hello": var hello = string.Format("Hello World, {0}!", appUser.FirstName); Bot.SendMessage(message.Chat.Id, hello); break; } } public override void OnBotException(BotRequestException exp) { Console.WriteLine("New BotException: {0}", exp.Message); Console.WriteLine("Error Code: {0}", exp.ErrorCode); Console.WriteLine(); } public override void OnException(Exception exp) { Console.WriteLine("New Exception: {0}", exp.Message); Console.WriteLine(); } } } ``` ================================================ FILE: src/examples/Callback query button 01/Callback query button 01.csproj ================================================ Exe net8.0 CallbackQueryButton01 ================================================ FILE: src/examples/Callback query button 01/Program.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.GettingUpdates; using Telegram.BotAPI.UpdatingMessages; Console.WriteLine("Start!"); TelegramBotClient bot = new(""); bot.SetMyCommands([new BotCommand("callback", "new callback")]); // Long Polling IEnumerable updates = bot.GetUpdates(); while (true) { if (updates.Any()) { foreach (Update update in updates) { if (update.Message?.Chat is not null && !string.IsNullOrEmpty(update.Message.Text)) { if (!update.Message.Text.Contains("/callback")) { continue; } InlineKeyboardMarkup replyMarkup = new( new InlineKeyboardButton[][] { [new InlineKeyboardButton("Callback") { CallbackData = "callback_data" }], } ); bot.SendMessage( update.Message.Chat.Id, "Message with callback data", replyMarkup: replyMarkup ); } else if (update.CallbackQuery?.Message is not null) { bot.AnswerCallbackQuery(update.CallbackQuery.Id, "HELLO"); bot.EditMessageText( update.CallbackQuery.Message.Chat.Id, update.CallbackQuery.Message.MessageId, $"Click!\n\n{update.CallbackQuery.Data}" ); } } updates = updates = bot.GetUpdates(updates.Max(u => u.UpdateId) + 1); } else { updates = bot.GetUpdates(); } } ================================================ FILE: src/examples/Callback query button 01/readme.md ================================================ # Callback query button - Sample 01 ## Description .NET Core console app Create a button with the /callback command Pressing it edits the message, removing the button and typing new text. ## Preview ![callbacks gif](/docs/media/samples/CallbackButton.gif) ## Source Code ```CSharp using System; using System.Linq; using Telegram.BotAPI; using Telegram.BotAPI.GettingUpdates; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.UpdatingMessages; namespace CallbackQueryButton01 { class Program { static void Main() { Console.WriteLine("Start!"); var bot = new TelegramBotClient(""); bot.SetMyCommands(new BotCommand("callback", "new callback")); var updates = bot.GetUpdates(); while (true) { if (updates.Length > 0) { foreach (var update in updates) { switch (update.Type) { case UpdateType.Message: var message = update.Message; if (message.Text.Contains("/callback")) { var replyMarkup = new InlineKeyboardMarkup { InlineKeyboard = new InlineKeyboardButton[][]{ new InlineKeyboardButton[]{ InlineKeyboardButton.SetCallbackData("Callback", "callback_data") } } }; bot.SendMessage(message.Chat.Id, "Message with callback data", replyMarkup: replyMarkup); } break; case UpdateType.CallbackQuery: var query = update.CallbackQuery; bot.AnswerCallbackQuery(query.Id, "HELLO"); bot.EditMessageText(new EditMessageTextArgs { ChatId = query.Message.Chat.Id, MessageId = query.Message.MessageId, Text = $"Click!\n\n{query.Data}" }); break; } } updates = updates = bot.GetUpdates(offset: updates.Max(u => u.UpdateId) + 1); } else { updates = bot.GetUpdates(); } } } } } ``` ================================================ FILE: src/examples/Examples.sln ================================================  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.2.32519.379 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotTemplateSample", "BotTemplate\BotTemplateSample.csproj", "{90EBAC9A-9A49-4A4B-A863-246EC41F5D59}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Callback query button 01", "Callback query button 01\Callback query button 01.csproj", "{0292D292-A156-4619-959F-70DB6F45440B}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hello World", "Hello World\Hello World.csproj", "{2FBF087D-A1E6-47A7-9344-C17AA494150A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Poll Quiz 01", "Poll Quiz 01\Poll Quiz 01.csproj", "{CD140BB0-8F69-4A38-ABC0-49DEF01D4615}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReplyKeyboardMarkup 01", "ReplyKeyboardMarkup 01\ReplyKeyboardMarkup 01.csproj", "{295293AC-04D4-432F-BBA0-5A5F9A4F22F3}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Telegram Calendar", "Telegram Calendar\Telegram Calendar.csproj", "{CB877447-C492-43E4-B7A9-3534B7619039}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloBotNET.Webhook", "HelloBotNET.Webhook\HelloBotNET.Webhook.csproj", "{4A7EC7DA-03F3-40B5-8993-DA90C5CC589C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{7A82B466-5509-490E-A490-D64D871CBA06}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{ADD476C3-7C77-421E-8A5F-F5DC41886727}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Telegram.BotAPI", "..\library\Telegram.BotAPI\Telegram.BotAPI.csproj", "{7885DD73-1782-4D0E-826E-C60C27C7648D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloBotNET.AppService", "HelloBotNET.AppService\HelloBotNET.AppService.csproj", "{40F07F65-6DF5-48D2-9C11-0D970BFA31A0}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Telegram.BotAPI.Extensions", "..\library\Telegram.BotAPI.Extensions\Telegram.BotAPI.Extensions.csproj", "{5E7D52AF-3914-47AA-9136-A87520D8119D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {90EBAC9A-9A49-4A4B-A863-246EC41F5D59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {90EBAC9A-9A49-4A4B-A863-246EC41F5D59}.Debug|Any CPU.Build.0 = Debug|Any CPU {90EBAC9A-9A49-4A4B-A863-246EC41F5D59}.Release|Any CPU.ActiveCfg = Release|Any CPU {90EBAC9A-9A49-4A4B-A863-246EC41F5D59}.Release|Any CPU.Build.0 = Release|Any CPU {0292D292-A156-4619-959F-70DB6F45440B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0292D292-A156-4619-959F-70DB6F45440B}.Debug|Any CPU.Build.0 = Debug|Any CPU {0292D292-A156-4619-959F-70DB6F45440B}.Release|Any CPU.ActiveCfg = Release|Any CPU {0292D292-A156-4619-959F-70DB6F45440B}.Release|Any CPU.Build.0 = Release|Any CPU {2FBF087D-A1E6-47A7-9344-C17AA494150A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2FBF087D-A1E6-47A7-9344-C17AA494150A}.Debug|Any CPU.Build.0 = Debug|Any CPU {2FBF087D-A1E6-47A7-9344-C17AA494150A}.Release|Any CPU.ActiveCfg = Release|Any CPU {2FBF087D-A1E6-47A7-9344-C17AA494150A}.Release|Any CPU.Build.0 = Release|Any CPU {CD140BB0-8F69-4A38-ABC0-49DEF01D4615}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CD140BB0-8F69-4A38-ABC0-49DEF01D4615}.Debug|Any CPU.Build.0 = Debug|Any CPU {CD140BB0-8F69-4A38-ABC0-49DEF01D4615}.Release|Any CPU.ActiveCfg = Release|Any CPU {CD140BB0-8F69-4A38-ABC0-49DEF01D4615}.Release|Any CPU.Build.0 = Release|Any CPU {295293AC-04D4-432F-BBA0-5A5F9A4F22F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {295293AC-04D4-432F-BBA0-5A5F9A4F22F3}.Debug|Any CPU.Build.0 = Debug|Any CPU {295293AC-04D4-432F-BBA0-5A5F9A4F22F3}.Release|Any CPU.ActiveCfg = Release|Any CPU {295293AC-04D4-432F-BBA0-5A5F9A4F22F3}.Release|Any CPU.Build.0 = Release|Any CPU {CB877447-C492-43E4-B7A9-3534B7619039}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CB877447-C492-43E4-B7A9-3534B7619039}.Debug|Any CPU.Build.0 = Debug|Any CPU {CB877447-C492-43E4-B7A9-3534B7619039}.Release|Any CPU.ActiveCfg = Release|Any CPU {CB877447-C492-43E4-B7A9-3534B7619039}.Release|Any CPU.Build.0 = Release|Any CPU {4A7EC7DA-03F3-40B5-8993-DA90C5CC589C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4A7EC7DA-03F3-40B5-8993-DA90C5CC589C}.Debug|Any CPU.Build.0 = Debug|Any CPU {4A7EC7DA-03F3-40B5-8993-DA90C5CC589C}.Release|Any CPU.ActiveCfg = Release|Any CPU {4A7EC7DA-03F3-40B5-8993-DA90C5CC589C}.Release|Any CPU.Build.0 = Release|Any CPU {7885DD73-1782-4D0E-826E-C60C27C7648D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7885DD73-1782-4D0E-826E-C60C27C7648D}.Debug|Any CPU.Build.0 = Debug|Any CPU {7885DD73-1782-4D0E-826E-C60C27C7648D}.Release|Any CPU.ActiveCfg = Release|Any CPU {7885DD73-1782-4D0E-826E-C60C27C7648D}.Release|Any CPU.Build.0 = Release|Any CPU {40F07F65-6DF5-48D2-9C11-0D970BFA31A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {40F07F65-6DF5-48D2-9C11-0D970BFA31A0}.Debug|Any CPU.Build.0 = Debug|Any CPU {40F07F65-6DF5-48D2-9C11-0D970BFA31A0}.Release|Any CPU.ActiveCfg = Release|Any CPU {40F07F65-6DF5-48D2-9C11-0D970BFA31A0}.Release|Any CPU.Build.0 = Release|Any CPU {5E7D52AF-3914-47AA-9136-A87520D8119D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5E7D52AF-3914-47AA-9136-A87520D8119D}.Debug|Any CPU.Build.0 = Debug|Any CPU {5E7D52AF-3914-47AA-9136-A87520D8119D}.Release|Any CPU.ActiveCfg = Release|Any CPU {5E7D52AF-3914-47AA-9136-A87520D8119D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {90EBAC9A-9A49-4A4B-A863-246EC41F5D59} = {7A82B466-5509-490E-A490-D64D871CBA06} {0292D292-A156-4619-959F-70DB6F45440B} = {7A82B466-5509-490E-A490-D64D871CBA06} {2FBF087D-A1E6-47A7-9344-C17AA494150A} = {7A82B466-5509-490E-A490-D64D871CBA06} {CD140BB0-8F69-4A38-ABC0-49DEF01D4615} = {7A82B466-5509-490E-A490-D64D871CBA06} {295293AC-04D4-432F-BBA0-5A5F9A4F22F3} = {7A82B466-5509-490E-A490-D64D871CBA06} {CB877447-C492-43E4-B7A9-3534B7619039} = {7A82B466-5509-490E-A490-D64D871CBA06} {4A7EC7DA-03F3-40B5-8993-DA90C5CC589C} = {7A82B466-5509-490E-A490-D64D871CBA06} {7885DD73-1782-4D0E-826E-C60C27C7648D} = {ADD476C3-7C77-421E-8A5F-F5DC41886727} {40F07F65-6DF5-48D2-9C11-0D970BFA31A0} = {7A82B466-5509-490E-A490-D64D871CBA06} {5E7D52AF-3914-47AA-9136-A87520D8119D} = {ADD476C3-7C77-421E-8A5F-F5DC41886727} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {936E7344-448B-4497-970E-1AC2EC609933} EndGlobalSection EndGlobal ================================================ FILE: src/examples/Hello World/Hello World.csproj ================================================ Exe net8.0 HelloWorld ================================================ FILE: src/examples/Hello World/Program.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.GettingUpdates; Console.WriteLine("Start!"); TelegramBotClient bot = new(""); // Long Polling IEnumerable updates = bot.GetUpdates(); while (true) { if (updates.Any()) { foreach (Update update in updates) { if (update.Message != null) { Message message = update.Message; //bot.SendChatAction(message.Chat.Id, ChatAction.Typing); bot.SendMessage(message.Chat.Id, "Hello World!"); } } updates = bot.GetUpdates(updates.Max(u => u.UpdateId) + 1); } else { updates = bot.GetUpdates(); } } ================================================ FILE: src/examples/Hello World/readme.md ================================================ # Hello World - Sample ## Description .NET Core console app The bot sends "Hello World!" when it receives a message ## Preview ![hello world gif](/docs/media/samples/HelloWorld.gif) ## Source Code ```CSharp using System; using System.Linq; using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.GettingUpdates; namespace HelloWorld { class Program { static void Main() { Console.WriteLine("Start!"); var bot = new TelegramBotClient(""); var updates = bot.GetUpdates(); while (true) { if (updates.Length > 0) { foreach (var update in updates) { if (update.Type == UpdateType.Message) { var message = update.Message; //bot.SendChatAction(message.Chat.Id, ChatAction.Typing); bot.SendMessage(message.Chat.Id, "Hello World!"); } } updates = bot.GetUpdates(offset: updates.Max(u => u.UpdateId) + 1); } else { updates = bot.GetUpdates(); } } } } } ``` ================================================ FILE: src/examples/HelloBotNET.AppService/HelloBotNET.AppService.csproj ================================================ net8.0 enable enable dotnet-HelloBotNET-51BA3BFF-ACF3-4D96-B57C-8CFDD2B87F9E ================================================ FILE: src/examples/HelloBotNET.AppService/Program.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using HelloBotNET.AppService; using HelloBotNET.AppService.Services; IHost host = Host.CreateDefaultBuilder(args) .ConfigureServices( (_, services) => { // Add bot service. services.AddSingleton(); // Add long polling service services.AddHostedService(); } ) .Build(); await host.RunAsync(); ================================================ FILE: src/examples/HelloBotNET.AppService/Properties/launchSettings.json ================================================ { "profiles": { "HelloBotNET.AppService": { "commandName": "Project", "environmentVariables": { "DOTNET_ENVIRONMENT": "Development" }, "dotnetRunMessages": true }, "Docker": { "commandName": "Docker" } } } ================================================ FILE: src/examples/HelloBotNET.AppService/Properties/serviceDependencies.json ================================================ { "dependencies": { "secrets1": { "type": "secrets" } } } ================================================ FILE: src/examples/HelloBotNET.AppService/Properties/serviceDependencies.local.json ================================================ { "dependencies": { "secrets1": { "type": "secrets.user" } } } ================================================ FILE: src/examples/HelloBotNET.AppService/Services/HelloBot.CommandHandler.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; namespace HelloBotNET.AppService.Services; /// /// It contains the main functionality of the telegram bot.
/// The application creates a new instance of this class to process each update received. ///
public partial class HelloBot { protected override void OnCommand(Message message, string commandName, string commandParameters) { string[] args = commandParameters.Split(' '); #if DEBUG this.logger.LogInformation("Params: {ArgsLenght}", args.Length); #endif switch (commandName) { case "hello": // Reply to /hello command string hello = $"Hello World, {message.From!.FirstName}!"; this.Client.SendMessage(message.Chat.Id, hello); break; /* case "command1": // ... break; case "command2": // ... break; */ default: if (message.Chat.Type == ChatTypes.Private) { this.Client.SendMessage(message.Chat.Id, "Unrecognized command."); } break; } } } ================================================ FILE: src/examples/HelloBotNET.AppService/Services/HelloBot.ErrorHandler.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using Telegram.BotAPI; namespace HelloBotNET.AppService.Services; /// /// It contains the main functionality of the telegram bot.
/// The application creates a new instance of this class to process each update received. ///
public partial class HelloBot { protected override void OnBotException(BotRequestException exp) => this.logger.LogError("BotRequestException: {Message}", exp.Message); protected override void OnException(Exception exp) => this.logger.LogError("Exception: {Message}", exp.Message); } ================================================ FILE: src/examples/HelloBotNET.AppService/Services/HelloBot.MessageHandler.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using Telegram.BotAPI; using Telegram.BotAPI.AvailableTypes; namespace HelloBotNET.AppService.Services; /// /// It contains the main functionality of the telegram bot.
/// The application creates a new instance of this class to process each update received. ///
public partial class HelloBot { protected override void OnMessage(Message message) { // Ignore user 777000 (Telegram) if (message.From?.Id == TelegramConstants.TelegramId) { return; } bool hasText = !string.IsNullOrEmpty(message.Text); // True if message has text; #if DEBUG this.logger.LogInformation("New message from chat id: {ChatId}", message.Chat.Id); this.logger.LogInformation("Message: {MessageContent}", hasText ? message.Text : "No text"); #endif base.OnMessage(message); } } ================================================ FILE: src/examples/HelloBotNET.AppService/Services/HelloBot.UpdateHandler.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using Telegram.BotAPI.Extensions; using Telegram.BotAPI.GettingUpdates; namespace HelloBotNET.AppService.Services; /// /// It contains the main functionality of the telegram bot.
/// The application creates a new instance of this class to process each update received. ///
public partial class HelloBot { public override void OnUpdate(Update update) { #if DEBUG this.logger.LogInformation( "New update with id: {UpdateId}. Type: {UpdateType}", update.UpdateId, update.GetUpdateType() ); #endif base.OnUpdate(update); } } ================================================ FILE: src/examples/HelloBotNET.AppService/Services/HelloBot.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.Extensions; namespace HelloBotNET.AppService.Services { /// /// It contains the main functionality of the telegram bot.
/// The application creates a new instance of this class to process each update received. ///
public partial class HelloBot : SimpleUpdateHandlerBase { private readonly ILogger logger; public HelloBot(ILogger logger, IConfiguration configuration) { this.logger = logger; string? botToken = configuration.GetValue("Telegram:BotToken"); this.Client = new TelegramBotClient(botToken); string? myUsername = this.Client.GetMe().Username!; // This will provide a better command filtering. this.SetCommandExtractor(myUsername); } public ITelegramBotClient Client { get; } } } ================================================ FILE: src/examples/HelloBotNET.AppService/Worker.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using HelloBotNET.AppService.Services; using Telegram.BotAPI; using Telegram.BotAPI.GettingUpdates; namespace HelloBotNET.AppService; public class Worker(ILogger logger, HelloBot bot) : BackgroundService { protected override async Task ExecuteAsync(CancellationToken stoppingToken) { logger.LogInformation("Worker running at: {Time}", DateTimeOffset.Now); ITelegramBotClient client = bot.Client; // Long Polling IEnumerable updates = await client.GetUpdatesAsync( cancellationToken: stoppingToken ); while (!stoppingToken.IsCancellationRequested) { if (updates.Any()) { Parallel.ForEach(updates, this.ProcessUpdate); updates = await client .GetUpdatesAsync(updates.Last().UpdateId + 1, cancellationToken: stoppingToken) .ConfigureAwait(false); } else { updates = await client .GetUpdatesAsync(cancellationToken: stoppingToken) .ConfigureAwait(false); } } } private void ProcessUpdate(Update update) => bot.OnUpdate(update); public override Task StopAsync(CancellationToken cancellationToken) { logger.LogInformation("Worker stopping at: {Time}", DateTimeOffset.Now); return base.StopAsync(cancellationToken); } } ================================================ FILE: src/examples/HelloBotNET.AppService/appsettings.Development.json ================================================ { "Logging": { "LogLevel": { "Default": "Information", "Microsoft.Hosting.Lifetime": "Information" } } } ================================================ FILE: src/examples/HelloBotNET.AppService/appsettings.json ================================================ { "Logging": { "LogLevel": { "Default": "Information", "Microsoft.Hosting.Lifetime": "Information" } } } ================================================ FILE: src/examples/HelloBotNET.AppService/readme.md ================================================ # HelloBotNET This is a Hello World telegram bot made with NET 6 using Long Polling. ## How to Run You just need to specify your **bot token** in the `HelloBotNET.AppService` project. Your `secrets.json` or `appsettings.json` should look like the following code: ```JSON { "Telegram": { "BotToken": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11" } } ``` You can also use enviroment variables instead: | Env | Description | | :-------------------------------- | :--------------------------------------------------------------- | | Telegram__BotToken | Your bot token provided by [@BotFather](https://t.me/BotFather). | Finally, run `HelloBotNET.AppService` and see the magic. ================================================ FILE: src/examples/HelloBotNET.Webhook/Controllers/BotController.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using HelloBotNET.Webhook.Services; using Microsoft.AspNetCore.Mvc; using Telegram.BotAPI.GettingUpdates; namespace HelloBotNET.Webhook.Controllers; [ApiController] [Route("[controller]")] public class BotController : ControllerBase { private readonly HelloBot bot; private readonly IConfiguration configuration; private readonly ILogger logger; public BotController(ILogger logger, IConfiguration configuration, HelloBot bot) { this.logger = logger; this.configuration = configuration; this.bot = bot; } [HttpPost] public async Task PostAsync( [FromHeader(Name = "X-Telegram-Bot-Api-Secret-Token")] string webhookToken, [FromBody] Update update, CancellationToken cancellationToken ) { if (this.configuration["Telegram:WebhookToken"] != webhookToken) { #if DEBUG this.logger.LogWarning("Failed access"); #endif this.Unauthorized(); } if (update == default) { #if DEBUG this.logger.LogWarning("Invalid update detected"); #endif return this.BadRequest(); } this.bot.OnUpdate(update); return await Task.FromResult(this.Ok()); } } ================================================ FILE: src/examples/HelloBotNET.Webhook/Extensions/ApplicationBuilderExtensions.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using HelloBotNET.Webhook.Services; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.GettingUpdates; namespace HelloBotNET.Webhook.Extensions; /// /// Extension methods for . /// public static class ApplicationBuilderExtensions { /// /// Registers the Telegram Webhook. /// /// The instance this method extends. /// The instance this method extends. /// public static IApplicationBuilder UseTelegramWebhook(this IApplicationBuilder app) { if (app is null) { throw new ArgumentNullException(nameof(app)); } var configuration = app.ApplicationServices.GetRequiredService(); var bot = app.ApplicationServices.GetRequiredService(); var webhookToken = configuration["Telegram:WebhookToken"]; // ENV: Telegram__WebhookToken, JSON: "Telegram:WebhookToken" var webhookUrl = configuration["Telegram:WebhookUrl"]; // ENV: Telegram__WebhookUrl, JSON: "Telegram:WebhookUrl" // Delete my old commands bot.Client.DeleteMyCommands(); // Set my commands bot.Client.SetMyCommands([new BotCommand("hello", "Hello world!")]); // Delete webhook bot.Client.DeleteWebhook(); // Set webhook bot.Client.SetWebhook(webhookUrl + "/bot", secretToken: webhookToken); return app; } } ================================================ FILE: src/examples/HelloBotNET.Webhook/HelloBotNET.Webhook.csproj ================================================ net8.0 enable enable HelloBotNET.Webhook d0d5de81-a20b-4e69-8762-ebf03c089384 ================================================ FILE: src/examples/HelloBotNET.Webhook/Program.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using HelloBotNET.Webhook.Extensions; using HelloBotNET.Webhook.Services; var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(); // Add bot service. builder.Services.AddSingleton(); var app = builder.Build(); // Configure the HTTP request pipeline. app.UseHttpsRedirection(); app.MapControllers(); // Register que webhook app.UseTelegramWebhook(); app.Run(); ================================================ FILE: src/examples/HelloBotNET.Webhook/Properties/launchSettings.json ================================================ { "$schema": "http://json.schemastore.org/launchsettings.json", "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:4756", "sslPort": 44311 } }, "profiles": { "HelloBotNET.Webhook": { "commandName": "Project", "launchBrowser": true, "applicationUrl": "https://localhost:7001;http://localhost:7000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } } ================================================ FILE: src/examples/HelloBotNET.Webhook/Services/HelloBot.CommandHandler.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; namespace HelloBotNET.Webhook.Services; /// /// It contains the main functionality of the telegram bot.
/// The application creates a new instance of this class to process each update received. ///
public partial class HelloBot { protected override void OnCommand(Message message, string commandName, string commandParameters) { string[] args = commandParameters.Split(' '); #if DEBUG this.logger.LogInformation("Params: {ArgsLenght}", args.Length); #endif switch (commandName) { case "hello": // Reply to /hello command string hello = $"Hello World, {message.From!.FirstName}!"; this.Client.SendMessage(message.Chat.Id, hello); break; /* case "command1": // ... break; case "command2": // ... break; */ default: if (message.Chat.Type == ChatTypes.Private) { this.Client.SendMessage(message.Chat.Id, "Unrecognized command."); } break; } } } ================================================ FILE: src/examples/HelloBotNET.Webhook/Services/HelloBot.ErrorHandler.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using Telegram.BotAPI; namespace HelloBotNET.Webhook.Services; /// /// It contains the main functionality of the telegram bot.
/// The application creates a new instance of this class to process each update received. ///
public partial class HelloBot { protected override void OnBotException(BotRequestException exp) => this.logger.LogError("BotRequestException: {Message}", exp.Message); protected override void OnException(Exception exp) => this.logger.LogError("Exception: {Message}", exp.Message); } ================================================ FILE: src/examples/HelloBotNET.Webhook/Services/HelloBot.MessageHandler.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using Telegram.BotAPI; using Telegram.BotAPI.AvailableTypes; namespace HelloBotNET.Webhook.Services; /// /// It contains the main functionality of the telegram bot.
/// The application creates a new instance of this class to process each update received. ///
public partial class HelloBot { protected override void OnMessage(Message message) { // Ignore user 777000 (Telegram) if (message.From?.Id == TelegramConstants.TelegramId) { return; } bool hasText = !string.IsNullOrEmpty(message.Text); // True if message has text; #if DEBUG this.logger.LogInformation("New message from chat id: {ChatId}", message.Chat.Id); this.logger.LogInformation("Message: {MessageContent}", hasText ? message.Text : "No text"); #endif base.OnMessage(message); } } ================================================ FILE: src/examples/HelloBotNET.Webhook/Services/HelloBot.UpdateHandler.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using Telegram.BotAPI.Extensions; using Telegram.BotAPI.GettingUpdates; namespace HelloBotNET.Webhook.Services; /// /// It contains the main functionality of the telegram bot.
/// The application creates a new instance of this class to process each update received. ///
public partial class HelloBot { public override void OnUpdate(Update update) { #if DEBUG this.logger.LogInformation( "New update with id: {UpdateId}. Type: {UpdateType}", update.UpdateId, update.GetUpdateType() ); #endif base.OnUpdate(update); } } ================================================ FILE: src/examples/HelloBotNET.Webhook/Services/HelloBot.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.Extensions; namespace HelloBotNET.Webhook.Services; /// /// It contains the main functionality of the telegram bot.
/// The application creates a new instance of this class to process each update received. ///
public partial class HelloBot : SimpleUpdateHandlerBase { private readonly ILogger logger; public HelloBot(ILogger logger, IConfiguration configuration) { this.logger = logger; string botToken = configuration.GetValue("Telegram:BotToken") ?? throw new ArgumentNullException("Telegram:BotToken"); this.Client = new TelegramBotClient(botToken); string myUsername = this.Client.GetMe().Username!; // This will provide a better command filtering. this.SetCommandExtractor(myUsername); } public ITelegramBotClient Client { get; } } ================================================ FILE: src/examples/HelloBotNET.Webhook/appsettings.Development.json ================================================ { "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } } } ================================================ FILE: src/examples/HelloBotNET.Webhook/appsettings.json ================================================ { "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } }, "AllowedHosts": "*" } ================================================ FILE: src/examples/HelloBotNET.Webhook/readme.md ================================================ # HelloBotNET This is a Hello World telegram bot made with NET 6 using a webhook. ## How to Run If you want to run this bot you need to specify your **bot token**, the **application url** and a **secret token** in the `HelloBotNET.Webhook` project. Optionally, you can specify the **certificate** path to use with your webhook. Your `secrets.json` or `appsettings.json` should look like the following code: ```JSON { //"Certificate": "/etc/ssl/certs/custom_cert.pem", "Telegram": { "BotToken": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11", "WebhookUrl": "https://www.example.com", "WebhookToken": "SUPERSECRETPATH" } } ``` You can also use enviroment variables instead: | Env | Description | | :-------------------------------- | :--------------------------------------------------------------- | | Certificate | Optional. Certificate Path. | | Telegram__BotToken | Your bot token provided by [@BotFather](https://t.me/BotFather). | | Telegram__WebhookUrl | Your application url. Ex: | | Telegram__WebhookToken | Your secret token. It must be specified by yourself. | Finally, run `HelloBotNET.Webhook` and see the magic. ================================================ FILE: src/examples/Poll Quiz 01/Poll Quiz 01.csproj ================================================ Exe net8.0 Poll_Quiz_01 ================================================ FILE: src/examples/Poll Quiz 01/Program.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.GettingUpdates; Console.WriteLine("Start!"); TelegramBotClient bot = new(""); bot.SetMyCommands([new BotCommand("quiz", "New quiz")]); // Long Polling IEnumerable updates = bot.GetUpdates(); while (true) { if (updates.Any()) { foreach (Update update in updates) { if (update.Message?.Text?.Contains("/quiz") is true) { bot.SendPoll( new SendPollArgs( update.Message.Chat.Id, "¿5 + 5?", [ new InputPollOption("56"), new InputPollOption("7"), new InputPollOption("10"), new InputPollOption("-4"), ] ) { Type = "quiz", CorrectOptionId = 2, } ); } } updates = bot.GetUpdates(updates.Max(u => u.UpdateId) + 1); } else { updates = bot.GetUpdates(); } } ================================================ FILE: src/examples/Poll Quiz 01/readme.md ================================================ # Poll Quiz - Sample 01 ## Description .NET Core console app Create a quiz from the new polls 2.0 ## Preview ![quiz gif](/docs/media/samples/Quiz.gif) ## Source Code ```CSharp using System; using System.Linq; using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.GettingUpdates; namespace Poll_Quiz_01 { class Program { static void Main() { Console.WriteLine("Start!"); var bot = new TelegramBotClient(""); bot.SetMyCommands(new BotCommand("quiz", "New quiz")); var updates = bot.GetUpdates(); while (true) { if (updates.Length > 0) { foreach (var update in updates) { switch (update.Type) { case UpdateType.Message: if (update.Message.Text.Contains("/quiz")) { bot.SendPoll(new SendPollArgs { ChatId = update.Message.Chat.Id, Question = "¿5 + 5?", Options = new string[]{ "56", "7", "10", "-4" }, Type = "quiz", CorrectOptionId = 2 }); } break; } } updates = bot.GetUpdates(offset: updates.Max(u => u.UpdateId) + 1); } else { updates = bot.GetUpdates(); } } } } } ``` ================================================ FILE: src/examples/ReplyKeyboardMarkup 01/Program.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.GettingUpdates; Console.WriteLine("Start!"); TelegramBotClient client = new(""); client.SetMyCommands([new BotCommand("reply", "ReplyMarkup"), new BotCommand("del", "Delete")]); // Long Polling IEnumerable updates = client.GetUpdates(); while (true) { if (updates.Any()) { foreach (Update update in updates) { if (!string.IsNullOrEmpty(update.Message?.Text)) { if (update.Message.Text.Contains("/reply")) { ReplyKeyboardMarkup keyboard = new( [ [ new KeyboardButton("Button 1"), //column 1 row 1 new KeyboardButton( "Button 2" ) //column 1 row 2 , ], // column 1 [ new KeyboardButton( "Button 3" ) //col 2 row 1 , ] // column 2 , ] ) { ResizeKeyboard = true, }; client.SendMessage( update.Message.Chat.Id, "new keyboard", replyMarkup: keyboard ); } if (update.Message.Text.Contains("/del")) { client.SendMessage( update.Message.Chat.Id, "remove reply keyboard", replyMarkup: new ReplyKeyboardRemove() ); } } } updates = client.GetUpdates(updates.Max(u => u.UpdateId) + 1); } else { updates = client.GetUpdates(); } } ================================================ FILE: src/examples/ReplyKeyboardMarkup 01/ReplyKeyboardMarkup 01.csproj ================================================ Exe net8.0 ReplyKeyboardMarkup_01 ================================================ FILE: src/examples/ReplyKeyboardMarkup 01/readme.md ================================================ # Reply keyboard markup - Sample 01 ## Description .NET Core console app Create a reply keyboard ## Preview ![keyboard gif](/docs/media/samples/ReplyKeyboard.gif) ## Source Code ```CSharp using System; using System.Linq; using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.GettingUpdates; namespace ReplyKeyboardMarkup_01 { class Program { static void Main() { Console.WriteLine("Start!"); var bot = new TelegramBotClient(""); var updates = bot.GetUpdates(); bot.SetMyCommands(new BotCommand("reply", "ReplyMarkup"), new BotCommand("del", "Delete")); while (true) { if (updates.Length > 0) { foreach (var update in updates) { switch (update.Type) { case UpdateType.Message: if (update.Message.Text.Contains("/reply")) { var keyboard = new ReplyKeyboardMarkup { Keyboard = new KeyboardButton[][]{ new KeyboardButton[]{ new KeyboardButton("Button 1"), //column 1 row 1 new KeyboardButton("Button 2") //column 1 row 2 },// column 1 new KeyboardButton[]{ new KeyboardButton("Button 3") //col 2 row 1 } // column 2 }, ResizeKeyboard = true }; ; bot.SendMessage(update.Message.Chat.Id, "new keyboard", replyMarkup: keyboard); } if (update.Message.Text.Contains("/del")) { bot.SendMessage(update.Message.Chat.Id, "remove reply keyboard", replyMarkup: new ReplyKeyboardRemove()); } break; } } updates = bot.GetUpdates(offset: updates.Max(u => u.UpdateId) + 1); } else { updates = bot.GetUpdates(); } } } } } ``` ================================================ FILE: src/examples/Telegram Calendar/Calendar.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System; using IKB = Telegram.BotAPI.AvailableTypes.InlineKeyboardButton; namespace TelegramCalendar; public static class Calendar { public static IKB[][] New(DateTime dateTime) { var year = dateTime.Year; var keyboard = new IKB[6][]; keyboard[0] = [new IKB($"{year}") { CallbackData = $"Year {year}" }]; for (int i = 1, n = 0; i < 5; i++) { keyboard[i] = new IKB[3]; for (int j = 0; j < 3; j++, n++) { var month = (MonthName)n; keyboard[i][j] = new IKB($"{month}") { CallbackData = $"month {year} {n}" }; } } keyboard[5] = [ new IKB($"{year - 1}") { CallbackData = $"year {year - 1}" }, new IKB($"{year + 1}") { CallbackData = $"year {year + 1}" }, ]; return keyboard; } public static IKB[][] New(Month mon) { var calendar = new IKB[mon.Weeks + 3][]; var pos = 0; calendar[0] = [new IKB($"{mon.Name} {mon.Year}") { CallbackData = $"year {mon.Year}" }]; var days = new[] { "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" }; calendar[1] = new IKB[7]; for (int i = 0; i < 7; i++) { calendar[1][i] = new IKB(days[i]) { CallbackData = $"{((DayOfWeek)i)}" }; } for (int i = 2; i < mon.Weeks + 2; i++) { calendar[i] = new IKB[7]; for (int j = 0; j < 7; j++) { if (pos < mon.Days.Length) { if ((int)mon.Days[pos].Name == j) { calendar[i][j] = new IKB($"{mon.Days[pos].Number}") { CallbackData = $"{mon.Days[pos].Name}, {mon.Name} {mon.Days[pos].Number}", }; pos++; } else { calendar[i][j] = new IKB("*") { CallbackData = "Empty day" }; } } else { calendar[i][j] = new IKB("*") { CallbackData = "Empty day" }; } } } calendar[^1] = new IKB[2]; var previousMonth = mon.Name == MonthName.January ? MonthName.December : mon.Name - 1; var nextMonth = mon.Name == MonthName.December ? MonthName.January : mon.Name + 1; var previousYear = previousMonth == MonthName.December ? mon.Year - 1 : mon.Year; var nextYear = nextMonth == MonthName.January ? mon.Year + 1 : mon.Year; calendar[^1][0] = new IKB($"{previousMonth}") { CallbackData = $"month {previousYear} {(ushort)previousMonth}", }; calendar[^1][1] = new IKB($"{nextMonth}") { CallbackData = $"month {nextYear} {(ushort)nextMonth}", }; return calendar; } public static IKB[][] New(uint year) { var keyboard = new IKB[6][]; keyboard[0] = [new IKB($"{year}") { CallbackData = $"Year {year}" }]; for (int i = 1, n = 0; i < 5; i++) { keyboard[i] = new IKB[3]; for (int j = 0; j < 3; j++, n++) { var month = (MonthName)n; keyboard[i][j] = new IKB($"{month}") { CallbackData = $"month {year} {n}" }; } } keyboard[5] = [ new IKB($"{year - 1}") { CallbackData = $"year {year - 1}" }, new IKB($"{year + 1}") { CallbackData = $"year {year + 1}" }, ]; return keyboard; } } ================================================ FILE: src/examples/Telegram Calendar/CalendarBot.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System; using System.Linq; using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.Extensions; using Telegram.BotAPI.UpdatingMessages; namespace TelegramCalendar; public sealed class CalendarBot : SimpleUpdateHandlerBase { public TelegramBotClient Client { get; } = new(""); protected override void OnMessage(Message message) { var text = message.Text; if (string.IsNullOrEmpty(text) || !text.Contains("/calendar")) { return; } var rm = new InlineKeyboardMarkup(Calendar.New(DateTime.Now)); this.Client.SendMessage( message.Chat.Id, "🗓 Telegram Bot Calendar 🗓", parseMode: FormatStyles.HTML, replyMarkup: rm ); } protected override void OnCallbackQuery(CallbackQuery query) { if (query.Message is null || string.IsNullOrEmpty(query.Data)) { return; } var queryArgs = query.Data.Split(' '); switch (queryArgs.ElementAt(0)) { case "month": var month = new Month( (MonthName)Enum.Parse(typeof(MonthName), queryArgs[2]), uint.Parse(queryArgs[1]) ); this.Client.EditMessageReplyMarkup( query.Message.Chat.Id, query.Message.MessageId, replyMarkup: new InlineKeyboardMarkup(Calendar.New(month)) ); break; case "year": this.Client.EditMessageReplyMarkup( query.Message.Chat.Id, query.Message.MessageId, replyMarkup: new InlineKeyboardMarkup(Calendar.New(uint.Parse(queryArgs[1]))) ); break; default: this.Client.AnswerCallbackQuery(query.Id, query.Data, true); break; } } protected override void OnException(Exception exp) { if (exp is BotRequestException) { Console.WriteLine("Bot Exception: {0}.", exp.Message); } else { Console.WriteLine("Exception: {0}.", exp.Message); } } } ================================================ FILE: src/examples/Telegram Calendar/Models/Day.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System; namespace TelegramCalendar; public sealed class Day(DayOfWeek name, ushort number) { public DayOfWeek Name { get; set; } = name; public ushort Number { get; set; } = number; } ================================================ FILE: src/examples/Telegram Calendar/Models/Month.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System; namespace TelegramCalendar; public sealed class Month { public Month(MonthName monthName, uint year) { this.Name = monthName; this.Year = year; bool leapYear = this.Year % 4 == 0; int days = this.Name switch { MonthName.February => leapYear ? 29 : 28, MonthName.April => 30, MonthName.June => 30, MonthName.September => 30, MonthName.November => 30, _ => 31, }; this.Days = new Day[days]; long firstDay = (year * 365) + (leapYear ? -1 : 0) + ((year - (year % 4)) / 4) - ((year - (year % 400)) / 400) + 4; int month = (int)monthName; firstDay += month < 1 ? 0 : 31; firstDay += month < 2 ? 0 : leapYear ? 29 : 28; firstDay += month < 3 ? 0 : 31; firstDay += month < 4 ? 0 : 30; firstDay += month < 5 ? 0 : 31; firstDay += month < 6 ? 0 : 30; firstDay += month < 7 ? 0 : 31; firstDay += month < 8 ? 0 : 31; firstDay += month < 9 ? 0 : 30; firstDay += month < 10 ? 0 : 31; firstDay += month < 11 ? 0 : 30; firstDay %= 7; for (int i = 0; i < this.Days.Length; i++) { this.Days[i] = new Day((DayOfWeek)((i + firstDay) % 7), (ushort)(i + 1)); } } public uint Year { get; set; } public MonthName Name { get; set; } public Day[] Days { get; set; } public ushort Weeks { get { int days = (int)this.Days[0].Name + this.Days.Length - 1; return (ushort)(((days - (days % 7)) / 7) + (days % 7 > 0 ? 1 : 0)); } } } ================================================ FILE: src/examples/Telegram Calendar/Models/MonthName.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. namespace TelegramCalendar; public enum MonthName { January, February, March, April, May, June, July, August, September, October, November, December, } ================================================ FILE: src/examples/Telegram Calendar/Program.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.GettingUpdates; using TelegramCalendar; Console.WriteLine("Start!"); CalendarBot bot = new(); bot.Client.SetMyCommands([new BotCommand("calendar", "Telegram Calendar")]); // Long Polling IEnumerable updates = bot.Client.GetUpdates( allowedUpdates: [UpdateTypes.Message, UpdateTypes.CallbackQuery] ); while (true) { if (updates.Any()) { foreach (Update update in updates) { bot.OnUpdate(update); } updates = bot.Client.GetUpdates(updates.Max(u => u.UpdateId) + 1); } else { updates = bot.Client.GetUpdates(); } } ================================================ FILE: src/examples/Telegram Calendar/Telegram Calendar.csproj ================================================  Exe net8.0 TelegramCalendar ================================================ FILE: src/examples/Telegram Calendar/readme.md ================================================ # Telegram Bot Calendar ## Description .NET Core console app A simple calendar with inline buttons and callback queries. ## Preview ![calendar gif](/docs/media/samples/Calendar.gif) ## Source Code ```CSharp // By Quetzal Rivera using System; using System.Linq; using Telegram.BotAPI; using Telegram.BotAPI.AvailableMethods; using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.GettingUpdates; using Telegram.BotAPI.UpdatingMessages; namespace TelegramCalendar { class Program { private static TelegramBotClient bot = new TelegramBotClient(""); static void Main() { Console.WriteLine("Start!"); bot.SetMyCommands(new BotCommand("calendar", "Telegram Calendar")); var updates = bot.GetUpdates(); while (true) { if (updates.Length > 0) { foreach (var update in updates) { switch (update.Type) { case UpdateType.Message: OnMessage(update.Message); break; case UpdateType.CallbackQuery: OnCallbackQuery(update.CallbackQuery); break; } } updates = bot.GetUpdates(offset: updates.Max(u => u.UpdateId) + 1); } else { updates = bot.GetUpdates(); } } } private static void OnMessage(Message message) { if (message.Text.Contains("/calendar")) { var rm = new InlineKeyboardMarkup { InlineKeyboard = CreateCalendar(2021) }; bot.SendMessage(message.Chat.Id, "🗓 Telegram Bot Calendar 🗓", parseMode: ParseMode.HTML, replyMarkup: rm); } } private static void OnCallbackQuery(CallbackQuery query) { var cbargs = query.Data.Split(' '); switch (cbargs[0]) { case "month": var month = new Month((MonthName)Enum.Parse(typeof(MonthName), cbargs[2]), uint.Parse(cbargs[1])); var mkeyboard = new InlineKeyboardMarkup { InlineKeyboard = CreateCalendar(month) }; bot.EditMessageReplyMarkup(new EditMessageReplyMarkup { ChatId = query.Message.Chat.Id, MessageId = query.Message.MessageId, ReplyMarkup = mkeyboard }); break; case "year": var ykeyboard = new InlineKeyboardMarkup { InlineKeyboard = CreateCalendar(uint.Parse(cbargs[1])) }; bot.EditMessageReplyMarkup(new EditMessageReplyMarkup { ChatId = query.Message.Chat.Id, MessageId = query.Message.MessageId, ReplyMarkup = ykeyboard }); break; default: bot.AnswerCallbackQuery(new AnswerCallbackQueryArgs { CallbackQueryId = query.Id, Text = query.Data, ShowAlert = true }); break; } } public static InlineKeyboardButton[][] CreateCalendar(Month mon) { var calendar = new InlineKeyboardButton[mon.Weeks + 3][]; var pos = 0; calendar[0] = new InlineKeyboardButton[1] { InlineKeyboardButton.SetCallbackData($"{mon.Name} {mon.Year}", $"year {mon.Year}") }; var days = new[] { "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su" }; calendar[1] = new InlineKeyboardButton[7]; for (int i = 0; i < 7; i++) { calendar[1][i] = InlineKeyboardButton.SetCallbackData(days[i], $"{((DayName)i)}"); } for (int i = 2; i < mon.Weeks + 2; i++) { calendar[i] = new InlineKeyboardButton[7]; for (int j = 0; j < 7; j++) { if (pos < mon.Days.Length) { if ((int)mon.Days[pos].Name == j) { calendar[i][j] = InlineKeyboardButton.SetCallbackData($"{mon.Days[pos].Number}", $"{mon.Days[pos].Name}, {mon.Name} {mon.Days[pos].Number}"); pos++; } else { calendar[i][j] = InlineKeyboardButton.SetCallbackData("*", "Empty day"); } } else { calendar[i][j] = InlineKeyboardButton.SetCallbackData("*", "Empty day"); } } } calendar[calendar.Length - 1] = new InlineKeyboardButton[2]; var previousmonth = mon.Name == MonthName.January ? MonthName.December : mon.Name - 1; var nextmonth = mon.Name == MonthName.December ? MonthName.January : mon.Name + 1; var previousyear = previousmonth == MonthName.December ? mon.Year - 1 : mon.Year; var nextyear = nextmonth == MonthName.January ? mon.Year + 1 : mon.Year; calendar[calendar.Length - 1][0] = InlineKeyboardButton.SetCallbackData($"{previousmonth}", $"month {previousyear} {((ushort)previousmonth)}"); calendar[calendar.Length - 1][1] = InlineKeyboardButton.SetCallbackData($"{nextmonth}", $"month {nextyear} {((ushort)nextmonth)}"); return calendar; } public static InlineKeyboardButton[][] CreateCalendar(uint year) { var keyboard = new InlineKeyboardButton[6][]; keyboard[0] = new InlineKeyboardButton[1]{ InlineKeyboardButton.SetCallbackData($"{year}", $"Year {year}") }; for (int i = 1, n = 0; i < 5; i++) { keyboard[i] = new InlineKeyboardButton[3]; for (int j = 0; j < 3; j++, n++) { var month = (MonthName)n; keyboard[i][j] = new InlineKeyboardButton { Text = $"{month}", CallbackData = $"month {year} {n}" }; } } keyboard[5] = new InlineKeyboardButton[2]{ InlineKeyboardButton.SetCallbackData($"{year - 1}",$"year {year - 1}"), InlineKeyboardButton.SetCallbackData($"{year + 1}",$"year {year + 1}") }; return keyboard; } } public enum DayName { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday } public class Day { public Day(DayName name, ushort number) { Name = name; Number = number; } public DayName Name { get; set; } public ushort Number { get; set; } } public enum MonthName { January, February, March, April, May, June, July, August, September, October, November, December } public Month(MonthName monthName, uint year) { Name = monthName; Year = year; var leapyear = Year % 4 == 0; var days = Name == MonthName.February ? (leapyear ? 29 : 28) : (Name == MonthName.April || Name == MonthName.June || Name == MonthName.September || Name == MonthName.November ? 30 : 31); Days = new Day[days]; var firstday = year * 365 + (leapyear ? -1 : 0) + (((year - (year % 4)) / 4)) - (((year - (year % 400)) / 400)) + 3; var month = (int)monthName; firstday += month < 1 ? 0 : 31; firstday += month < 2 ? 0 : (leapyear ? 29 : 28); firstday += month < 3 ? 0 : 31; firstday += month < 4 ? 0 : 30; firstday += month < 5 ? 0 : 31; firstday += month < 6 ? 0 : 30; firstday += month < 7 ? 0 : 31; firstday += month < 8 ? 0 : 31; firstday += month < 9 ? 0 : 30; firstday += month < 10 ? 0 : 31; firstday += month < 11 ? 0 : 30; firstday = firstday % 7; for (int i = 0; i < Days.Length; i++) Days[i] = new Day((DayName)((i + firstday) % 7), (ushort)(i + 1)); } public uint Year { get; set; } public MonthName Name { get; set; } public Day[] Days { get; set; } public ushort Weeks { get { var days = (int)Days[0].Name + Days.Length - 1; return (ushort)(((days - (days % 7)) / 7) + (days % 7 > 0 ? 1 : 0)); } } } } ``` ================================================ FILE: src/examples/readme.md ================================================ # Telegram.BotAPI NET Examples [![NuGet version (Telegram.BotAPI)](https://img.shields.io/nuget/v/Telegram.BotAPI?style=flat-square&logo=nuget)](https://www.nuget.org/packages/Telegram.BotAPI/) [![Compatible with Bot API v10.0](https://img.shields.io/badge/Bot%20API%20version-v10.0-blue?style=flat-square)](https://core.telegram.org/bots/api#april-3-2026) ## Sample list - [HelloBotNET.AppService](HelloBotNET.AppService) \[Recommended] \[Long Polling] \[Service] - [HelloBotNET.Webhook](HelloBotNET.Webhook) \[Recommended] \[Webhook] - [ShopBot](https://github.com/Eptagone/ShopBot) \[Recommended] - [Hello World](Hello%20World/readme.md) - [BotTemplate](BotTemplate/readme.md) - [Poll Quiz](Poll%20Quiz%2001/readme.md) - [Callback query 01](Callback%20query%20button%2001/readme.md) - [Reply keyboard markup 01](ReplyKeyboardMarkup%2001/readme.md) - [Telegram Bot Calendar](Telegram%20Calendar/readme.md) ================================================ FILE: src/library/Telegram.BotAPI/Abstractions/ITelegramBot.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using Telegram.BotAPI.GettingUpdates; namespace Telegram.BotAPI; /// /// Represents a Telegram Bot. /// Defines methods for receiving and processing incoming updates. /// [Obsolete( "Use IUpdateHandler or IAsyncUpdateHandler instead from Telegram.BotAPI.Extensions package. This interface will be removed in a future version." )] public interface ITelegramBot { /// /// Receives and processes an incoming update. /// /// The incoming update. void OnUpdate(Update update); /// /// Receives and processes an incoming update. /// /// The incoming update. /// A cancellation token. /// A task that represents the asynchronous operation. /// Task OnUpdateAsync(Update update, CancellationToken cancellationToken = default); } ================================================ FILE: src/library/Telegram.BotAPI/Abstractions/ITelegramBotClient.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System.Net.Http; using System.Text.Json; namespace Telegram.BotAPI; /// /// Defines methods to make requests to the Telegram Bot API. /// public interface ITelegramBotClient { /// /// Options used to configure the client. /// TelegramBotClientOptions Options { get; } /// /// Calls a method of the Telegram Bot API and returns the result. /// /// Result type. /// Method name. /// Method arguments. /// An object containing the result of the API call. /// The method arguments are invalid. /// The request failed and the Bot API returned an error. /// The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. /// The response could not be deserialized. TResult CallMethod(string method, object? args = null); /// /// Calls a method of the Telegram Bot API and returns the result. /// /// Result type. /// Method name. /// Method arguments. /// A to cancel the request. /// An object containing the result of the API call. /// The method arguments are invalid. /// The request failed and the Bot API returned an error. /// The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. /// The response could not be deserialized. /// The request was canceled. Task CallMethodAsync( string method, object? args = null, CancellationToken cancellationToken = default ); /// /// Calls a method of the Telegram Bot API and returns the response. /// /// Response type. /// Method name. /// Method arguments. /// A object containing the response. /// The method arguments are invalid. /// The request failed and the Bot API returned an error. /// The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. /// The response could not be deserialized. BotResponse CallMethodDirect(string method, object? args = null); /// /// Calls a method of the Telegram Bot API and returns the response. /// /// Response type. /// Method name. /// Method arguments. /// A to cancel the request. /// A object containing the response. /// The method arguments are invalid. /// The request failed and the Bot API returned an error. /// The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. /// The response could not be deserialized. /// The request was canceled. Task> CallMethodDirectAsync( string method, object? args = null, CancellationToken cancellationToken = default ); } ================================================ FILE: src/library/Telegram.BotAPI/Abstractions/SendAttachedFilesArgsBase.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI; /// /// Defines a property to send attached files through multipart/form-data. /// public abstract class AttachedFilesArgsBase { /// /// Files to send. /// [JsonIgnore] public IDictionary Files { get; set; } = new Dictionary(); } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/AnswerCallbackQueryArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Games; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "AnswerCallbackQuery" method. /// public class AnswerCallbackQueryArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the query to be answered public AnswerCallbackQueryArgs(string callbackQueryId) { this.CallbackQueryId = callbackQueryId ?? throw new ArgumentNullException(nameof(callbackQueryId)); } /// /// Unique identifier for the query to be answered /// [JsonPropertyName(PropertyNames.CallbackQueryId)] public string CallbackQueryId { get; set; } /// /// Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters /// [JsonPropertyName(PropertyNames.Text)] public string? Text { get; set; } /// /// If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false. /// [JsonPropertyName(PropertyNames.ShowAlert)] public bool? ShowAlert { get; set; } /// /// URL that will be opened by the user's client. If you have created a and accepted the conditions via @BotFather, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button.

Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. ///
[JsonPropertyName(PropertyNames.Url)] public string? Url { get; set; } /// /// The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0. /// [JsonPropertyName(PropertyNames.CacheTime)] public int? CacheTime { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/AnswerGuestQueryArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.InlineMode; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "AnswerGuestQuery" method. /// public class AnswerGuestQueryArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the query to be answered /// A JSON-serialized object describing the message to be sent public AnswerGuestQueryArgs(string guestQueryId, InlineQueryResult result) { this.GuestQueryId = guestQueryId ?? throw new ArgumentNullException(nameof(guestQueryId)); this.Result = result ?? throw new ArgumentNullException(nameof(result)); } /// /// Unique identifier for the query to be answered /// [JsonPropertyName(PropertyNames.GuestQueryId)] public string GuestQueryId { get; set; } /// /// A JSON-serialized object describing the message to be sent /// [JsonPropertyName(PropertyNames.Result)] public InlineQueryResult Result { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/AnswerWebAppQueryArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.InlineMode; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "AnswerWebAppQuery" method. /// public class AnswerWebAppQueryArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the query to be answered /// A JSON-serialized object describing the message to be sent public AnswerWebAppQueryArgs(string webAppQueryId, InlineQueryResult result) { this.WebAppQueryId = webAppQueryId ?? throw new ArgumentNullException(nameof(webAppQueryId)); this.Result = result ?? throw new ArgumentNullException(nameof(result)); } /// /// Unique identifier for the query to be answered /// [JsonPropertyName(PropertyNames.WebAppQueryId)] public string WebAppQueryId { get; set; } /// /// A JSON-serialized object describing the message to be sent /// [JsonPropertyName(PropertyNames.Result)] public InlineQueryResult Result { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/CopyMessageArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "CopyMessage" method. /// public class CopyMessageArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id public CopyMessageArgs(long chatId, long fromChatId, int messageId) { this.ChatId = chatId; this.FromChatId = fromChatId; this.MessageId = messageId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id public CopyMessageArgs(long chatId, string fromChatId, int messageId) { this.ChatId = chatId; this.FromChatId = fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)); this.MessageId = messageId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id public CopyMessageArgs(string chatId, long fromChatId, int messageId) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.FromChatId = fromChatId; this.MessageId = messageId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id public CopyMessageArgs(string chatId, string fromChatId, int messageId) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.FromChatId = fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)); this.MessageId = messageId; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// [JsonPropertyName(PropertyNames.FromChatId)] public object FromChatId { get; set; } /// /// Message identifier in the chat specified in from_chat_id /// [JsonPropertyName(PropertyNames.MessageId)] public int MessageId { get; set; } /// /// New start timestamp for the copied video in the message /// [JsonPropertyName(PropertyNames.VideoStartTimestamp)] public int? VideoStartTimestamp { get; set; } /// /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Mode for parsing entities in the new caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. /// [JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)] public bool? ShowCaptionAboveMedia { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; only available when copying to private chats /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/CopyMessagesArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "CopyMessages" method. /// public class CopyMessagesArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. public CopyMessagesArgs(long chatId, long fromChatId, IEnumerable messageIds) { this.ChatId = chatId; this.FromChatId = fromChatId; this.MessageIds = messageIds ?? throw new ArgumentNullException(nameof(messageIds)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. public CopyMessagesArgs(long chatId, string fromChatId, IEnumerable messageIds) { this.ChatId = chatId; this.FromChatId = fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)); this.MessageIds = messageIds ?? throw new ArgumentNullException(nameof(messageIds)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. public CopyMessagesArgs(string chatId, long fromChatId, IEnumerable messageIds) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.FromChatId = fromChatId; this.MessageIds = messageIds ?? throw new ArgumentNullException(nameof(messageIds)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. public CopyMessagesArgs(string chatId, string fromChatId, IEnumerable messageIds) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.FromChatId = fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)); this.MessageIds = messageIds ?? throw new ArgumentNullException(nameof(messageIds)); } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// [JsonPropertyName(PropertyNames.FromChatId)] public object FromChatId { get; set; } /// /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. /// [JsonPropertyName(PropertyNames.MessageIds)] public IEnumerable MessageIds { get; set; } /// /// Sends the messages silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent messages from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to copy the messages without their captions /// [JsonPropertyName(PropertyNames.RemoveCaption)] public bool? RemoveCaption { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/CreateChatInviteLinkArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "CreateChatInviteLink" method. /// public class CreateChatInviteLinkArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel in the format @username public CreateChatInviteLinkArgs(long chatId) { this.ChatId = chatId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel in the format @username public CreateChatInviteLinkArgs(string chatId) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); } /// /// Unique identifier for the target chat or username of the target channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Invite link name; 0-32 characters /// [JsonPropertyName(PropertyNames.Name)] public string? Name { get; set; } /// /// Point in time (Unix timestamp) when the link will expire /// [JsonPropertyName(PropertyNames.ExpireDate)] public int? ExpireDate { get; set; } /// /// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 /// [JsonPropertyName(PropertyNames.MemberLimit)] public int? MemberLimit { get; set; } /// /// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified /// [JsonPropertyName(PropertyNames.CreatesJoinRequest)] public bool? CreatesJoinRequest { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/DeleteBusinessMessagesArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "DeleteBusinessMessages" method. /// public class DeleteBusinessMessagesArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier of the business connection on behalf of which to delete the messages /// A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted public DeleteBusinessMessagesArgs(string businessConnectionId, IEnumerable messageIds) { this.BusinessConnectionId = businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)); this.MessageIds = messageIds ?? throw new ArgumentNullException(nameof(messageIds)); } /// /// Unique identifier of the business connection on behalf of which to delete the messages /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string BusinessConnectionId { get; set; } /// /// A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted /// [JsonPropertyName(PropertyNames.MessageIds)] public IEnumerable MessageIds { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/DeleteMyCommandsArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "DeleteMyCommands" method. /// public class DeleteMyCommandsArgs { /// /// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to . /// [JsonPropertyName(PropertyNames.Scope)] public BotCommandScope? Scope { get; set; } /// /// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands /// [JsonPropertyName(PropertyNames.LanguageCode)] public string? LanguageCode { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/EditChatInviteLinkArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "EditChatInviteLink" method. /// public class EditChatInviteLinkArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel in the format @username /// The invite link to edit public EditChatInviteLinkArgs(long chatId, string inviteLink) { this.ChatId = chatId; this.InviteLink = inviteLink ?? throw new ArgumentNullException(nameof(inviteLink)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel in the format @username /// The invite link to edit public EditChatInviteLinkArgs(string chatId, string inviteLink) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.InviteLink = inviteLink ?? throw new ArgumentNullException(nameof(inviteLink)); } /// /// Unique identifier for the target chat or username of the target channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// The invite link to edit /// [JsonPropertyName(PropertyNames.InviteLink)] public string InviteLink { get; set; } /// /// Invite link name; 0-32 characters /// [JsonPropertyName(PropertyNames.Name)] public string? Name { get; set; } /// /// Point in time (Unix timestamp) when the link will expire /// [JsonPropertyName(PropertyNames.ExpireDate)] public int? ExpireDate { get; set; } /// /// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 /// [JsonPropertyName(PropertyNames.MemberLimit)] public int? MemberLimit { get; set; } /// /// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified /// [JsonPropertyName(PropertyNames.CreatesJoinRequest)] public bool? CreatesJoinRequest { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/EditStoryArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "EditStory" method. /// public class EditStoryArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier of the business connection /// Unique identifier of the story to edit /// Content of the story public EditStoryArgs(string businessConnectionId, int storyId, InputStoryContent content) { this.BusinessConnectionId = businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)); this.StoryId = storyId; this.Content = content ?? throw new ArgumentNullException(nameof(content)); } /// /// Unique identifier of the business connection /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string BusinessConnectionId { get; set; } /// /// Unique identifier of the story to edit /// [JsonPropertyName(PropertyNames.StoryId)] public int StoryId { get; set; } /// /// Content of the story /// [JsonPropertyName(PropertyNames.Content)] public InputStoryContent Content { get; set; } /// /// Caption of the story, 0-2048 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Mode for parsing entities in the story caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// A JSON-serialized list of clickable areas to be shown on the story /// [JsonPropertyName(PropertyNames.Areas)] public IEnumerable? Areas { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/ForwardMessageArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "ForwardMessage" method. /// public class ForwardMessageArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id public ForwardMessageArgs(long chatId, long fromChatId, int messageId) { this.ChatId = chatId; this.FromChatId = fromChatId; this.MessageId = messageId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id public ForwardMessageArgs(long chatId, string fromChatId, int messageId) { this.ChatId = chatId; this.FromChatId = fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)); this.MessageId = messageId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id public ForwardMessageArgs(string chatId, long fromChatId, int messageId) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.FromChatId = fromChatId; this.MessageId = messageId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id public ForwardMessageArgs(string chatId, string fromChatId, int messageId) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.FromChatId = fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)); this.MessageId = messageId; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// [JsonPropertyName(PropertyNames.FromChatId)] public object FromChatId { get; set; } /// /// New start timestamp for the forwarded video in the message /// [JsonPropertyName(PropertyNames.VideoStartTimestamp)] public int? VideoStartTimestamp { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the forwarded message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Unique identifier of the message effect to be added to the message; only available when forwarding to private chats /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Message identifier in the chat specified in from_chat_id /// [JsonPropertyName(PropertyNames.MessageId)] public int MessageId { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/ForwardMessagesArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "ForwardMessages" method. /// public class ForwardMessagesArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. public ForwardMessagesArgs(long chatId, long fromChatId, IEnumerable messageIds) { this.ChatId = chatId; this.FromChatId = fromChatId; this.MessageIds = messageIds ?? throw new ArgumentNullException(nameof(messageIds)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. public ForwardMessagesArgs(long chatId, string fromChatId, IEnumerable messageIds) { this.ChatId = chatId; this.FromChatId = fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)); this.MessageIds = messageIds ?? throw new ArgumentNullException(nameof(messageIds)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. public ForwardMessagesArgs(string chatId, long fromChatId, IEnumerable messageIds) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.FromChatId = fromChatId; this.MessageIds = messageIds ?? throw new ArgumentNullException(nameof(messageIds)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. public ForwardMessagesArgs(string chatId, string fromChatId, IEnumerable messageIds) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.FromChatId = fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)); this.MessageIds = messageIds ?? throw new ArgumentNullException(nameof(messageIds)); } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// [JsonPropertyName(PropertyNames.FromChatId)] public object FromChatId { get; set; } /// /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. /// [JsonPropertyName(PropertyNames.MessageIds)] public IEnumerable MessageIds { get; set; } /// /// Sends the messages silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the forwarded messages from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/GetBusinessAccountGiftsArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "GetBusinessAccountGifts" method. /// public class GetBusinessAccountGiftsArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier of the business connection public GetBusinessAccountGiftsArgs(string businessConnectionId) { this.BusinessConnectionId = businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)); } /// /// Unique identifier of the business connection /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string BusinessConnectionId { get; set; } /// /// Pass True to exclude gifts that aren't saved to the account's profile page /// [JsonPropertyName(PropertyNames.ExcludeUnsaved)] public bool? ExcludeUnsaved { get; set; } /// /// Pass True to exclude gifts that are saved to the account's profile page /// [JsonPropertyName(PropertyNames.ExcludeSaved)] public bool? ExcludeSaved { get; set; } /// /// Pass True to exclude gifts that can be purchased an unlimited number of times /// [JsonPropertyName(PropertyNames.ExcludeUnlimited)] public bool? ExcludeUnlimited { get; set; } /// /// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique /// [JsonPropertyName(PropertyNames.ExcludeLimitedUpgradable)] public bool? ExcludeLimitedUpgradable { get; set; } /// /// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique /// [JsonPropertyName(PropertyNames.ExcludeLimitedNonUpgradable)] public bool? ExcludeLimitedNonUpgradable { get; set; } /// /// Pass True to exclude unique gifts /// [JsonPropertyName(PropertyNames.ExcludeUnique)] public bool? ExcludeUnique { get; set; } /// /// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram /// [JsonPropertyName(PropertyNames.ExcludeFromBlockchain)] public bool? ExcludeFromBlockchain { get; set; } /// /// Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. /// [JsonPropertyName(PropertyNames.SortByPrice)] public bool? SortByPrice { get; set; } /// /// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results /// [JsonPropertyName(PropertyNames.Offset)] public string? Offset { get; set; } /// /// The maximum number of gifts to be returned; 1-100. Defaults to 100 /// [JsonPropertyName(PropertyNames.Limit)] public int? Limit { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/GetChatGiftsArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "GetChatGifts" method. /// public class GetChatGiftsArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel in the format @username public GetChatGiftsArgs(long chatId) { this.ChatId = chatId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel in the format @username public GetChatGiftsArgs(string chatId) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); } /// /// Unique identifier for the target chat or username of the target channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel. /// [JsonPropertyName(PropertyNames.ExcludeUnsaved)] public bool? ExcludeUnsaved { get; set; } /// /// Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel. /// [JsonPropertyName(PropertyNames.ExcludeSaved)] public bool? ExcludeSaved { get; set; } /// /// Pass True to exclude gifts that can be purchased an unlimited number of times /// [JsonPropertyName(PropertyNames.ExcludeUnlimited)] public bool? ExcludeUnlimited { get; set; } /// /// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique /// [JsonPropertyName(PropertyNames.ExcludeLimitedUpgradable)] public bool? ExcludeLimitedUpgradable { get; set; } /// /// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique /// [JsonPropertyName(PropertyNames.ExcludeLimitedNonUpgradable)] public bool? ExcludeLimitedNonUpgradable { get; set; } /// /// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram /// [JsonPropertyName(PropertyNames.ExcludeFromBlockchain)] public bool? ExcludeFromBlockchain { get; set; } /// /// Pass True to exclude unique gifts /// [JsonPropertyName(PropertyNames.ExcludeUnique)] public bool? ExcludeUnique { get; set; } /// /// Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. /// [JsonPropertyName(PropertyNames.SortByPrice)] public bool? SortByPrice { get; set; } /// /// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results /// [JsonPropertyName(PropertyNames.Offset)] public string? Offset { get; set; } /// /// The maximum number of gifts to be returned; 1-100. Defaults to 100 /// [JsonPropertyName(PropertyNames.Limit)] public int? Limit { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/GetMyCommandsArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "GetMyCommands" method. /// public class GetMyCommandsArgs { /// /// A JSON-serialized object, describing scope of users. Defaults to . /// [JsonPropertyName(PropertyNames.Scope)] public BotCommandScope? Scope { get; set; } /// /// A two-letter ISO 639-1 language code or an empty string /// [JsonPropertyName(PropertyNames.LanguageCode)] public string? LanguageCode { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/GetUserGiftsArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "GetUserGifts" method. /// public class GetUserGiftsArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier of the user public GetUserGiftsArgs(long userId) { this.UserId = userId; } /// /// Unique identifier of the user /// [JsonPropertyName(PropertyNames.UserId)] public long UserId { get; set; } /// /// Pass True to exclude gifts that can be purchased an unlimited number of times /// [JsonPropertyName(PropertyNames.ExcludeUnlimited)] public bool? ExcludeUnlimited { get; set; } /// /// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique /// [JsonPropertyName(PropertyNames.ExcludeLimitedUpgradable)] public bool? ExcludeLimitedUpgradable { get; set; } /// /// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique /// [JsonPropertyName(PropertyNames.ExcludeLimitedNonUpgradable)] public bool? ExcludeLimitedNonUpgradable { get; set; } /// /// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram /// [JsonPropertyName(PropertyNames.ExcludeFromBlockchain)] public bool? ExcludeFromBlockchain { get; set; } /// /// Pass True to exclude unique gifts /// [JsonPropertyName(PropertyNames.ExcludeUnique)] public bool? ExcludeUnique { get; set; } /// /// Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. /// [JsonPropertyName(PropertyNames.SortByPrice)] public bool? SortByPrice { get; set; } /// /// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results /// [JsonPropertyName(PropertyNames.Offset)] public string? Offset { get; set; } /// /// The maximum number of gifts to be returned; 1-100. Defaults to 100 /// [JsonPropertyName(PropertyNames.Limit)] public int? Limit { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/GiftPremiumSubscriptionArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "GiftPremiumSubscription" method. /// public class GiftPremiumSubscriptionArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier of the target user who will receive a Telegram Premium subscription /// Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12 /// Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months public GiftPremiumSubscriptionArgs(long userId, int monthCount, int starCount) { this.UserId = userId; this.MonthCount = monthCount; this.StarCount = starCount; } /// /// Unique identifier of the target user who will receive a Telegram Premium subscription /// [JsonPropertyName(PropertyNames.UserId)] public long UserId { get; set; } /// /// Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12 /// [JsonPropertyName(PropertyNames.MonthCount)] public int MonthCount { get; set; } /// /// Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months /// [JsonPropertyName(PropertyNames.StarCount)] public int StarCount { get; set; } /// /// Text that will be shown along with the service message about the subscription; 0-128 characters /// [JsonPropertyName(PropertyNames.Text)] public string? Text { get; set; } /// /// Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored. /// [JsonPropertyName(PropertyNames.TextParseMode)] public string? TextParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored. /// [JsonPropertyName(PropertyNames.TextEntities)] public IEnumerable? TextEntities { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/PostStoryArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "PostStory" method. /// public class PostStoryArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier of the business connection /// Content of the story /// Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 public PostStoryArgs(string businessConnectionId, InputStoryContent content, int activePeriod) { this.BusinessConnectionId = businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)); this.Content = content ?? throw new ArgumentNullException(nameof(content)); this.ActivePeriod = activePeriod; } /// /// Unique identifier of the business connection /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string BusinessConnectionId { get; set; } /// /// Content of the story /// [JsonPropertyName(PropertyNames.Content)] public InputStoryContent Content { get; set; } /// /// Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 /// [JsonPropertyName(PropertyNames.ActivePeriod)] public int ActivePeriod { get; set; } /// /// Caption of the story, 0-2048 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Mode for parsing entities in the story caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// A JSON-serialized list of clickable areas to be shown on the story /// [JsonPropertyName(PropertyNames.Areas)] public IEnumerable? Areas { get; set; } /// /// Pass True to keep the story accessible after it expires /// [JsonPropertyName(PropertyNames.PostToChatPage)] public bool? PostToChatPage { get; set; } /// /// Pass True if the content of the story must be protected from forwarding and screenshotting /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/PromoteChatMemberArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "PromoteChatMember" method. /// public class PromoteChatMemberArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user public PromoteChatMemberArgs(long chatId, long userId) { this.ChatId = chatId; this.UserId = userId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user public PromoteChatMemberArgs(string chatId, long userId) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.UserId = userId; } /// /// Unique identifier for the target chat or username of the target channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier of the target user /// [JsonPropertyName(PropertyNames.UserId)] public long UserId { get; set; } /// /// Pass True if the administrator's presence in the chat is hidden /// [JsonPropertyName(PropertyNames.IsAnonymous)] public bool? IsAnonymous { get; set; } /// /// Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. /// [JsonPropertyName(PropertyNames.CanManageChat)] public bool? CanManageChat { get; set; } /// /// Pass True if the administrator can delete messages of other users /// [JsonPropertyName(PropertyNames.CanDeleteMessages)] public bool? CanDeleteMessages { get; set; } /// /// Pass True if the administrator can manage video chats /// [JsonPropertyName(PropertyNames.CanManageVideoChats)] public bool? CanManageVideoChats { get; set; } /// /// Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators /// [JsonPropertyName(PropertyNames.CanRestrictMembers)] public bool? CanRestrictMembers { get; set; } /// /// Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him) /// [JsonPropertyName(PropertyNames.CanPromoteMembers)] public bool? CanPromoteMembers { get; set; } /// /// Pass True if the administrator can change chat title, photo and other settings /// [JsonPropertyName(PropertyNames.CanChangeInfo)] public bool? CanChangeInfo { get; set; } /// /// Pass True if the administrator can invite new users to the chat /// [JsonPropertyName(PropertyNames.CanInviteUsers)] public bool? CanInviteUsers { get; set; } /// /// Pass True if the administrator can post stories to the chat /// [JsonPropertyName(PropertyNames.CanPostStories)] public bool? CanPostStories { get; set; } /// /// Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive /// [JsonPropertyName(PropertyNames.CanEditStories)] public bool? CanEditStories { get; set; } /// /// Pass True if the administrator can delete stories posted by other users /// [JsonPropertyName(PropertyNames.CanDeleteStories)] public bool? CanDeleteStories { get; set; } /// /// Pass True if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only /// [JsonPropertyName(PropertyNames.CanPostMessages)] public bool? CanPostMessages { get; set; } /// /// Pass True if the administrator can edit messages of other users and can pin messages; for channels only /// [JsonPropertyName(PropertyNames.CanEditMessages)] public bool? CanEditMessages { get; set; } /// /// Pass True if the administrator can pin messages; for supergroups only /// [JsonPropertyName(PropertyNames.CanPinMessages)] public bool? CanPinMessages { get; set; } /// /// Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only /// [JsonPropertyName(PropertyNames.CanManageTopics)] public bool? CanManageTopics { get; set; } /// /// Pass True if the administrator can manage direct messages within the channel and decline suggested posts; for channels only /// [JsonPropertyName(PropertyNames.CanManageDirectMessages)] public bool? CanManageDirectMessages { get; set; } /// /// Pass True if the administrator can edit the tags of regular members; for groups and supergroups only /// [JsonPropertyName(PropertyNames.CanManageTags)] public bool? CanManageTags { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/RepostStoryArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "RepostStory" method. /// public class RepostStoryArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier of the business connection /// Unique identifier of the chat which posted the story that should be reposted /// Unique identifier of the story that should be reposted /// Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 public RepostStoryArgs( string businessConnectionId, long fromChatId, int fromStoryId, int activePeriod ) { this.BusinessConnectionId = businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)); this.FromChatId = fromChatId; this.FromStoryId = fromStoryId; this.ActivePeriod = activePeriod; } /// /// Unique identifier of the business connection /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string BusinessConnectionId { get; set; } /// /// Unique identifier of the chat which posted the story that should be reposted /// [JsonPropertyName(PropertyNames.FromChatId)] public long FromChatId { get; set; } /// /// Unique identifier of the story that should be reposted /// [JsonPropertyName(PropertyNames.FromStoryId)] public int FromStoryId { get; set; } /// /// Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 /// [JsonPropertyName(PropertyNames.ActivePeriod)] public int ActivePeriod { get; set; } /// /// Pass True to keep the story accessible after it expires /// [JsonPropertyName(PropertyNames.PostToChatPage)] public bool? PostToChatPage { get; set; } /// /// Pass True if the content of the story must be protected from forwarding and screenshotting /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/RestrictChatMemberArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "RestrictChatMember" method. /// public class RestrictChatMemberArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// A JSON-serialized object for new user permissions public RestrictChatMemberArgs(long chatId, long userId, ChatPermissions permissions) { this.ChatId = chatId; this.UserId = userId; this.Permissions = permissions ?? throw new ArgumentNullException(nameof(permissions)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// A JSON-serialized object for new user permissions public RestrictChatMemberArgs(string chatId, long userId, ChatPermissions permissions) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.UserId = userId; this.Permissions = permissions ?? throw new ArgumentNullException(nameof(permissions)); } /// /// Unique identifier for the target chat or username of the target supergroup in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier of the target user /// [JsonPropertyName(PropertyNames.UserId)] public long UserId { get; set; } /// /// A JSON-serialized object for new user permissions /// [JsonPropertyName(PropertyNames.Permissions)] public ChatPermissions Permissions { get; set; } /// /// Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. /// [JsonPropertyName(PropertyNames.UseIndependentChatPermissions)] public bool? UseIndependentChatPermissions { get; set; } /// /// Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever /// [JsonPropertyName(PropertyNames.UntilDate)] public int? UntilDate { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SavePreparedInlineMessageArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.InlineMode; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SavePreparedInlineMessage" method. /// public class SavePreparedInlineMessageArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier of the target user that can use the prepared message /// A JSON-serialized object describing the message to be sent public SavePreparedInlineMessageArgs(long userId, InlineQueryResult result) { this.UserId = userId; this.Result = result ?? throw new ArgumentNullException(nameof(result)); } /// /// Unique identifier of the target user that can use the prepared message /// [JsonPropertyName(PropertyNames.UserId)] public long UserId { get; set; } /// /// A JSON-serialized object describing the message to be sent /// [JsonPropertyName(PropertyNames.Result)] public InlineQueryResult Result { get; set; } /// /// Pass True if the message can be sent to private chats with users /// [JsonPropertyName(PropertyNames.AllowUserChats)] public bool? AllowUserChats { get; set; } /// /// Pass True if the message can be sent to private chats with bots /// [JsonPropertyName(PropertyNames.AllowBotChats)] public bool? AllowBotChats { get; set; } /// /// Pass True if the message can be sent to group and supergroup chats /// [JsonPropertyName(PropertyNames.AllowGroupChats)] public bool? AllowGroupChats { get; set; } /// /// Pass True if the message can be sent to channel chats /// [JsonPropertyName(PropertyNames.AllowChannelChats)] public bool? AllowChannelChats { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SavePreparedKeyboardButtonArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SavePreparedKeyboardButton" method. /// public class SavePreparedKeyboardButtonArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier of the target user that can use the button /// A JSON-serialized object describing the button to be saved. The button must be of the type request_users, request_chat, or request_managed_bot public SavePreparedKeyboardButtonArgs(long userId, KeyboardButton button) { this.UserId = userId; this.Button = button ?? throw new ArgumentNullException(nameof(button)); } /// /// Unique identifier of the target user that can use the button /// [JsonPropertyName(PropertyNames.UserId)] public long UserId { get; set; } /// /// A JSON-serialized object describing the button to be saved. The button must be of the type request_users, request_chat, or request_managed_bot /// [JsonPropertyName(PropertyNames.Button)] public KeyboardButton Button { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendAnimationArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendAnimation" method. /// public class SendAnimationArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » public SendAnimationArgs(long chatId, InputFile animation) { this.ChatId = chatId; this.Animation = animation ?? throw new ArgumentNullException(nameof(animation)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » public SendAnimationArgs(long chatId, string animation) { this.ChatId = chatId; this.Animation = animation ?? throw new ArgumentNullException(nameof(animation)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » public SendAnimationArgs(string chatId, InputFile animation) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Animation = animation ?? throw new ArgumentNullException(nameof(animation)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » public SendAnimationArgs(string chatId, string animation) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Animation = animation ?? throw new ArgumentNullException(nameof(animation)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Animation)] public object Animation { get; set; } /// /// Duration of sent animation in seconds /// [JsonPropertyName(PropertyNames.Duration)] public int? Duration { get; set; } /// /// Animation width /// [JsonPropertyName(PropertyNames.Width)] public int? Width { get; set; } /// /// Animation height /// [JsonPropertyName(PropertyNames.Height)] public int? Height { get; set; } /// /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Thumbnail)] public object? Thumbnail { get; set; } /// /// Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Mode for parsing entities in the animation caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Pass True, if the caption must be shown above the message media /// [JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)] public bool? ShowCaptionAboveMedia { get; set; } /// /// Pass True if the animation needs to be covered with a spoiler animation /// [JsonPropertyName(PropertyNames.HasSpoiler)] public bool? HasSpoiler { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendAudioArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendAudio" method. /// public class SendAudioArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » public SendAudioArgs(long chatId, InputFile audio) { this.ChatId = chatId; this.Audio = audio ?? throw new ArgumentNullException(nameof(audio)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » public SendAudioArgs(long chatId, string audio) { this.ChatId = chatId; this.Audio = audio ?? throw new ArgumentNullException(nameof(audio)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » public SendAudioArgs(string chatId, InputFile audio) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Audio = audio ?? throw new ArgumentNullException(nameof(audio)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » public SendAudioArgs(string chatId, string audio) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Audio = audio ?? throw new ArgumentNullException(nameof(audio)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Audio)] public object Audio { get; set; } /// /// Audio caption, 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Mode for parsing entities in the audio caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Duration of the audio in seconds /// [JsonPropertyName(PropertyNames.Duration)] public int? Duration { get; set; } /// /// Performer /// [JsonPropertyName(PropertyNames.Performer)] public string? Performer { get; set; } /// /// Track name /// [JsonPropertyName(PropertyNames.Title)] public string? Title { get; set; } /// /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Thumbnail)] public object? Thumbnail { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendChecklistArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendChecklist" method. /// public class SendChecklistArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target chat or username of the target bot in the format @username /// A JSON-serialized object for the checklist to send public SendChecklistArgs(string businessConnectionId, long chatId, InputChecklist checklist) { this.BusinessConnectionId = businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)); this.ChatId = chatId; this.Checklist = checklist ?? throw new ArgumentNullException(nameof(checklist)); } /// /// Initializes a new instance of the class. /// /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target chat or username of the target bot in the format @username /// A JSON-serialized object for the checklist to send public SendChecklistArgs(string businessConnectionId, string chatId, InputChecklist checklist) { this.BusinessConnectionId = businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)); this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Checklist = checklist ?? throw new ArgumentNullException(nameof(checklist)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// A JSON-serialized object for the checklist to send /// [JsonPropertyName(PropertyNames.Checklist)] public InputChecklist Checklist { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Unique identifier of the message effect to be added to the message /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object for description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// A JSON-serialized object for an inline keyboard /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public InlineKeyboardMarkup? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendContactArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendContact" method. /// public class SendContactArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Contact's phone number /// Contact's first name public SendContactArgs(long chatId, string phoneNumber, string firstName) { this.ChatId = chatId; this.PhoneNumber = phoneNumber ?? throw new ArgumentNullException(nameof(phoneNumber)); this.FirstName = firstName ?? throw new ArgumentNullException(nameof(firstName)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Contact's phone number /// Contact's first name public SendContactArgs(string chatId, string phoneNumber, string firstName) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.PhoneNumber = phoneNumber ?? throw new ArgumentNullException(nameof(phoneNumber)); this.FirstName = firstName ?? throw new ArgumentNullException(nameof(firstName)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Contact's phone number /// [JsonPropertyName(PropertyNames.PhoneNumber)] public string PhoneNumber { get; set; } /// /// Contact's first name /// [JsonPropertyName(PropertyNames.FirstName)] public string FirstName { get; set; } /// /// Contact's last name /// [JsonPropertyName(PropertyNames.LastName)] public string? LastName { get; set; } /// /// Additional data about the contact in the form of a vCard, 0-2048 bytes /// [JsonPropertyName(PropertyNames.Vcard)] public string? Vcard { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendDiceArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendDice" method. /// public class SendDiceArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username public SendDiceArgs(long chatId) { this.ChatId = chatId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username public SendDiceArgs(string chatId) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲” /// [JsonPropertyName(PropertyNames.Emoji)] public string? Emoji { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendDocumentArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendDocument" method. /// public class SendDocumentArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » public SendDocumentArgs(long chatId, InputFile document) { this.ChatId = chatId; this.Document = document ?? throw new ArgumentNullException(nameof(document)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » public SendDocumentArgs(long chatId, string document) { this.ChatId = chatId; this.Document = document ?? throw new ArgumentNullException(nameof(document)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » public SendDocumentArgs(string chatId, InputFile document) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Document = document ?? throw new ArgumentNullException(nameof(document)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » public SendDocumentArgs(string chatId, string document) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Document = document ?? throw new ArgumentNullException(nameof(document)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Document)] public object Document { get; set; } /// /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Thumbnail)] public object? Thumbnail { get; set; } /// /// Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Mode for parsing entities in the document caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Disables automatic server-side content type detection for files uploaded using multipart/form-data /// [JsonPropertyName(PropertyNames.DisableContentTypeDetection)] public bool? DisableContentTypeDetection { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendGiftArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendGift" method. /// public class SendGiftArgs { /// /// Initializes a new instance of the class. /// /// Identifier of the gift; limited gifts can't be sent to channel chats public SendGiftArgs(string giftId) { this.GiftId = giftId ?? throw new ArgumentNullException(nameof(giftId)); } /// /// Required if chat_id is not specified. Unique identifier of the target user who will receive the gift. /// [JsonPropertyName(PropertyNames.UserId)] public long? UserId { get; set; } /// /// Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @username) that will receive the gift. /// [JsonPropertyName(PropertyNames.ChatId)] public object? ChatId { get; set; } /// /// Identifier of the gift; limited gifts can't be sent to channel chats /// [JsonPropertyName(PropertyNames.GiftId)] public string GiftId { get; set; } /// /// Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver /// [JsonPropertyName(PropertyNames.PayForUpgrade)] public bool? PayForUpgrade { get; set; } /// /// Text that will be shown along with the gift; 0-128 characters /// [JsonPropertyName(PropertyNames.Text)] public string? Text { get; set; } /// /// Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored. /// [JsonPropertyName(PropertyNames.TextParseMode)] public string? TextParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored. /// [JsonPropertyName(PropertyNames.TextEntities)] public IEnumerable? TextEntities { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendLivePhotoArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendLivePhoto" method. /// public class SendLivePhotoArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. public SendLivePhotoArgs(long chatId, InputFile livePhoto, InputFile photo) { this.ChatId = chatId; this.LivePhoto = livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. public SendLivePhotoArgs(long chatId, InputFile livePhoto, string photo) { this.ChatId = chatId; this.LivePhoto = livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. public SendLivePhotoArgs(long chatId, string livePhoto, InputFile photo) { this.ChatId = chatId; this.LivePhoto = livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. public SendLivePhotoArgs(long chatId, string livePhoto, string photo) { this.ChatId = chatId; this.LivePhoto = livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. public SendLivePhotoArgs(string chatId, InputFile livePhoto, InputFile photo) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.LivePhoto = livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. public SendLivePhotoArgs(string chatId, InputFile livePhoto, string photo) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.LivePhoto = livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. public SendLivePhotoArgs(string chatId, string livePhoto, InputFile photo) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.LivePhoto = livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. public SendLivePhotoArgs(string chatId, string livePhoto, string photo) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.LivePhoto = livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// [JsonPropertyName(PropertyNames.LivePhoto)] public object LivePhoto { get; set; } /// /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// [JsonPropertyName(PropertyNames.Photo)] public object Photo { get; set; } /// /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Mode for parsing entities in the video caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Pass True, if the caption must be shown above the message media /// [JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)] public bool? ShowCaptionAboveMedia { get; set; } /// /// Pass True if the video needs to be covered with a spoiler animation /// [JsonPropertyName(PropertyNames.HasSpoiler)] public bool? HasSpoiler { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendLocationArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendLocation" method. /// public class SendLocationArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Latitude of the location /// Longitude of the location public SendLocationArgs(long chatId, float latitude, float longitude) { this.ChatId = chatId; this.Latitude = latitude; this.Longitude = longitude; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Latitude of the location /// Longitude of the location public SendLocationArgs(string chatId, float latitude, float longitude) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Latitude = latitude; this.Longitude = longitude; } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Latitude of the location /// [JsonPropertyName(PropertyNames.Latitude)] public float Latitude { get; set; } /// /// Longitude of the location /// [JsonPropertyName(PropertyNames.Longitude)] public float Longitude { get; set; } /// /// The radius of uncertainty for the location, measured in meters; 0-1500 /// [JsonPropertyName(PropertyNames.HorizontalAccuracy)] public float? HorizontalAccuracy { get; set; } /// /// Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. /// [JsonPropertyName(PropertyNames.LivePeriod)] public int? LivePeriod { get; set; } /// /// For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. /// [JsonPropertyName(PropertyNames.Heading)] public int? Heading { get; set; } /// /// For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. /// [JsonPropertyName(PropertyNames.ProximityAlertRadius)] public int? ProximityAlertRadius { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendMediaGroupArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendMediaGroup" method. /// public class SendMediaGroupArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items public SendMediaGroupArgs(long chatId, IEnumerable media) { this.ChatId = chatId; this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items public SendMediaGroupArgs(long chatId, IEnumerable media) { this.ChatId = chatId; this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items public SendMediaGroupArgs(long chatId, IEnumerable media) { this.ChatId = chatId; this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items public SendMediaGroupArgs(long chatId, IEnumerable media) { this.ChatId = chatId; this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items public SendMediaGroupArgs(long chatId, IEnumerable media) { this.ChatId = chatId; this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items public SendMediaGroupArgs(string chatId, IEnumerable media) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items public SendMediaGroupArgs(string chatId, IEnumerable media) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items public SendMediaGroupArgs(string chatId, IEnumerable media) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items public SendMediaGroupArgs(string chatId, IEnumerable media) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items public SendMediaGroupArgs(string chatId, IEnumerable media) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// A JSON-serialized array describing messages to be sent, must include 2-10 items /// [JsonPropertyName(PropertyNames.Media)] public object Media { get; set; } /// /// Sends messages silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent messages from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendMessageArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendMessage" method. /// public class SendMessageArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Text of the message to be sent, 1-4096 characters after entities parsing public SendMessageArgs(long chatId, string text) { this.ChatId = chatId; this.Text = text ?? throw new ArgumentNullException(nameof(text)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Text of the message to be sent, 1-4096 characters after entities parsing public SendMessageArgs(string chatId, string text) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Text = text ?? throw new ArgumentNullException(nameof(text)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Text of the message to be sent, 1-4096 characters after entities parsing /// [JsonPropertyName(PropertyNames.Text)] public string Text { get; set; } /// /// Mode for parsing entities in the message text. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.Entities)] public IEnumerable? Entities { get; set; } /// /// Link preview generation options for the message /// [JsonPropertyName(PropertyNames.LinkPreviewOptions)] public LinkPreviewOptions? LinkPreviewOptions { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendMessageDraftArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendMessageDraft" method. /// public class SendMessageDraftArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target private chat /// Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated. public SendMessageDraftArgs(long chatId, int draftId) { this.ChatId = chatId; this.DraftId = draftId; } /// /// Unique identifier for the target private chat /// [JsonPropertyName(PropertyNames.ChatId)] public long ChatId { get; set; } /// /// Unique identifier for the target message thread /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated. /// [JsonPropertyName(PropertyNames.DraftId)] public int DraftId { get; set; } /// /// Text of the message to be sent, 0-4096 characters after entities parsing. Pass an empty text to show a “Thinking…” placeholder. /// [JsonPropertyName(PropertyNames.Text)] public string? Text { get; set; } /// /// Mode for parsing entities in the message text. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.Entities)] public IEnumerable? Entities { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendPaidMediaArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendPaidMedia" method. /// public class SendPaidMediaArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. /// The number of Telegram Stars that must be paid to buy access to the media; 1-25000 /// A JSON-serialized array describing the media to be sent; up to 10 items public SendPaidMediaArgs(long chatId, int starCount, IEnumerable media) { this.ChatId = chatId; this.StarCount = starCount; this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. /// The number of Telegram Stars that must be paid to buy access to the media; 1-25000 /// A JSON-serialized array describing the media to be sent; up to 10 items public SendPaidMediaArgs(string chatId, int starCount, IEnumerable media) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.StarCount = starCount; this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// The number of Telegram Stars that must be paid to buy access to the media; 1-25000 /// [JsonPropertyName(PropertyNames.StarCount)] public int StarCount { get; set; } /// /// A JSON-serialized array describing the media to be sent; up to 10 items /// [JsonPropertyName(PropertyNames.Media)] public IEnumerable Media { get; set; } /// /// Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. /// [JsonPropertyName(PropertyNames.Payload)] public string? Payload { get; set; } /// /// Media caption, 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Mode for parsing entities in the media caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Pass True, if the caption must be shown above the message media /// [JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)] public bool? ShowCaptionAboveMedia { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendPhotoArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendPhoto" method. /// public class SendPhotoArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » public SendPhotoArgs(long chatId, InputFile photo) { this.ChatId = chatId; this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » public SendPhotoArgs(long chatId, string photo) { this.ChatId = chatId; this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » public SendPhotoArgs(string chatId, InputFile photo) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » public SendPhotoArgs(string chatId, string photo) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Photo)] public object Photo { get; set; } /// /// Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Mode for parsing entities in the photo caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Pass True, if the caption must be shown above the message media /// [JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)] public bool? ShowCaptionAboveMedia { get; set; } /// /// Pass True if the photo needs to be covered with a spoiler animation /// [JsonPropertyName(PropertyNames.HasSpoiler)] public bool? HasSpoiler { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendPollArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; using InputPollMedia = Telegram.BotAPI.AvailableTypes.InputMedia; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendPoll" method. /// public class SendPollArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats. /// Poll question, 1-300 characters /// A JSON-serialized list of 1-12 answer options public SendPollArgs(long chatId, string question, IEnumerable options) { this.ChatId = chatId; this.Question = question ?? throw new ArgumentNullException(nameof(question)); this.Options = options ?? throw new ArgumentNullException(nameof(options)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats. /// Poll question, 1-300 characters /// A JSON-serialized list of 1-12 answer options public SendPollArgs(string chatId, string question, IEnumerable options) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Question = question ?? throw new ArgumentNullException(nameof(question)); this.Options = options ?? throw new ArgumentNullException(nameof(options)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats. /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Poll question, 1-300 characters /// [JsonPropertyName(PropertyNames.Question)] public string Question { get; set; } /// /// Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed /// [JsonPropertyName(PropertyNames.QuestionParseMode)] public string? QuestionParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode /// [JsonPropertyName(PropertyNames.QuestionEntities)] public IEnumerable? QuestionEntities { get; set; } /// /// A JSON-serialized list of 1-12 answer options /// [JsonPropertyName(PropertyNames.Options)] public IEnumerable Options { get; set; } /// /// True, if the poll needs to be anonymous, defaults to True /// [JsonPropertyName(PropertyNames.IsAnonymous)] public bool? IsAnonymous { get; set; } /// /// Poll type, “quiz” or “regular”, defaults to “regular” /// [JsonPropertyName(PropertyNames.Type)] public string? Type { get; set; } /// /// Pass True, if the poll allows multiple answers, defaults to False /// [JsonPropertyName(PropertyNames.AllowsMultipleAnswers)] public bool? AllowsMultipleAnswers { get; set; } /// /// Pass True, if the poll allows to change chosen answer options, defaults to False for quizzes and to True for regular polls /// [JsonPropertyName(PropertyNames.AllowsRevoting)] public bool? AllowsRevoting { get; set; } /// /// Pass True, if the poll options must be shown in random order /// [JsonPropertyName(PropertyNames.ShuffleOptions)] public bool? ShuffleOptions { get; set; } /// /// Pass True, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes /// [JsonPropertyName(PropertyNames.AllowAddingOptions)] public bool? AllowAddingOptions { get; set; } /// /// Pass True, if poll results must be shown only after the poll closes /// [JsonPropertyName(PropertyNames.HideResultsUntilCloses)] public bool? HideResultsUntilCloses { get; set; } /// /// Pass True, if voting is limited to users who have been members of the chat where the poll is being sent for more than 24 hours; for channel chats only /// [JsonPropertyName(PropertyNames.MembersOnly)] public bool? MembersOnly { get; set; } /// /// A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. If omitted or empty, then users from any country can participate in the poll. /// [JsonPropertyName(PropertyNames.CountryCodes)] public IEnumerable? CountryCodes { get; set; } /// /// A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode /// [JsonPropertyName(PropertyNames.CorrectOptionIds)] public IEnumerable? CorrectOptionIds { get; set; } /// /// Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing /// [JsonPropertyName(PropertyNames.Explanation)] public string? Explanation { get; set; } /// /// Mode for parsing entities in the explanation. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ExplanationParseMode)] public string? ExplanationParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode /// [JsonPropertyName(PropertyNames.ExplanationEntities)] public IEnumerable? ExplanationEntities { get; set; } /// /// Media added to the quiz explanation /// [JsonPropertyName(PropertyNames.ExplanationMedia)] public InputPollMedia? ExplanationMedia { get; set; } /// /// Amount of time in seconds the poll will be active after creation, 5-2628000. Can't be used together with close_date. /// [JsonPropertyName(PropertyNames.OpenPeriod)] public int? OpenPeriod { get; set; } /// /// Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 2628000 seconds in the future. Can't be used together with open_period. /// [JsonPropertyName(PropertyNames.CloseDate)] public int? CloseDate { get; set; } /// /// Pass True if the poll needs to be immediately closed. This can be useful for poll preview. /// [JsonPropertyName(PropertyNames.IsClosed)] public bool? IsClosed { get; set; } /// /// Description of the poll to be sent, 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Description)] public string? Description { get; set; } /// /// Mode for parsing entities in the poll description. See formatting options for more details. /// [JsonPropertyName(PropertyNames.DescriptionParseMode)] public string? DescriptionParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of description_parse_mode /// [JsonPropertyName(PropertyNames.DescriptionEntities)] public IEnumerable? DescriptionEntities { get; set; } /// /// Media added to the poll description /// [JsonPropertyName(PropertyNames.Media)] public InputPollMedia? Media { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendVenueArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendVenue" method. /// public class SendVenueArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Latitude of the venue /// Longitude of the venue /// Name of the venue /// Address of the venue public SendVenueArgs(long chatId, float latitude, float longitude, string title, string address) { this.ChatId = chatId; this.Latitude = latitude; this.Longitude = longitude; this.Title = title ?? throw new ArgumentNullException(nameof(title)); this.Address = address ?? throw new ArgumentNullException(nameof(address)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Latitude of the venue /// Longitude of the venue /// Name of the venue /// Address of the venue public SendVenueArgs( string chatId, float latitude, float longitude, string title, string address ) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Latitude = latitude; this.Longitude = longitude; this.Title = title ?? throw new ArgumentNullException(nameof(title)); this.Address = address ?? throw new ArgumentNullException(nameof(address)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Latitude of the venue /// [JsonPropertyName(PropertyNames.Latitude)] public float Latitude { get; set; } /// /// Longitude of the venue /// [JsonPropertyName(PropertyNames.Longitude)] public float Longitude { get; set; } /// /// Name of the venue /// [JsonPropertyName(PropertyNames.Title)] public string Title { get; set; } /// /// Address of the venue /// [JsonPropertyName(PropertyNames.Address)] public string Address { get; set; } /// /// Foursquare identifier of the venue /// [JsonPropertyName(PropertyNames.FoursquareId)] public string? FoursquareId { get; set; } /// /// Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) /// [JsonPropertyName(PropertyNames.FoursquareType)] public string? FoursquareType { get; set; } /// /// Google Places identifier of the venue /// [JsonPropertyName(PropertyNames.GooglePlaceId)] public string? GooglePlaceId { get; set; } /// /// Google Places type of the venue. (See supported types.) /// [JsonPropertyName(PropertyNames.GooglePlaceType)] public string? GooglePlaceType { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendVideoArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendVideo" method. /// public class SendVideoArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » public SendVideoArgs(long chatId, InputFile video) { this.ChatId = chatId; this.Video = video ?? throw new ArgumentNullException(nameof(video)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » public SendVideoArgs(long chatId, string video) { this.ChatId = chatId; this.Video = video ?? throw new ArgumentNullException(nameof(video)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » public SendVideoArgs(string chatId, InputFile video) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Video = video ?? throw new ArgumentNullException(nameof(video)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » public SendVideoArgs(string chatId, string video) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Video = video ?? throw new ArgumentNullException(nameof(video)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Video)] public object Video { get; set; } /// /// Duration of sent video in seconds /// [JsonPropertyName(PropertyNames.Duration)] public int? Duration { get; set; } /// /// Video width /// [JsonPropertyName(PropertyNames.Width)] public int? Width { get; set; } /// /// Video height /// [JsonPropertyName(PropertyNames.Height)] public int? Height { get; set; } /// /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Thumbnail)] public object? Thumbnail { get; set; } /// /// Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Cover)] public object? Cover { get; set; } /// /// Start timestamp for the video in the message /// [JsonPropertyName(PropertyNames.StartTimestamp)] public int? StartTimestamp { get; set; } /// /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Mode for parsing entities in the video caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Pass True, if the caption must be shown above the message media /// [JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)] public bool? ShowCaptionAboveMedia { get; set; } /// /// Pass True if the video needs to be covered with a spoiler animation /// [JsonPropertyName(PropertyNames.HasSpoiler)] public bool? HasSpoiler { get; set; } /// /// Pass True if the uploaded video is suitable for streaming /// [JsonPropertyName(PropertyNames.SupportsStreaming)] public bool? SupportsStreaming { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendVideoNoteArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendVideoNote" method. /// public class SendVideoNoteArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported public SendVideoNoteArgs(long chatId, InputFile videoNote) { this.ChatId = chatId; this.VideoNote = videoNote ?? throw new ArgumentNullException(nameof(videoNote)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported public SendVideoNoteArgs(long chatId, string videoNote) { this.ChatId = chatId; this.VideoNote = videoNote ?? throw new ArgumentNullException(nameof(videoNote)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported public SendVideoNoteArgs(string chatId, InputFile videoNote) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.VideoNote = videoNote ?? throw new ArgumentNullException(nameof(videoNote)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported public SendVideoNoteArgs(string chatId, string videoNote) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.VideoNote = videoNote ?? throw new ArgumentNullException(nameof(videoNote)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported /// [JsonPropertyName(PropertyNames.VideoNote)] public object VideoNote { get; set; } /// /// Duration of sent video in seconds /// [JsonPropertyName(PropertyNames.Duration)] public int? Duration { get; set; } /// /// Video width and height, i.e. diameter of the video message /// [JsonPropertyName(PropertyNames.Length)] public int? Length { get; set; } /// /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Thumbnail)] public object? Thumbnail { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SendVoiceArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SendVoice" method. /// public class SendVoiceArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » public SendVoiceArgs(long chatId, InputFile voice) { this.ChatId = chatId; this.Voice = voice ?? throw new ArgumentNullException(nameof(voice)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » public SendVoiceArgs(long chatId, string voice) { this.ChatId = chatId; this.Voice = voice ?? throw new ArgumentNullException(nameof(voice)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » public SendVoiceArgs(string chatId, InputFile voice) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Voice = voice ?? throw new ArgumentNullException(nameof(voice)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » public SendVoiceArgs(string chatId, string voice) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Voice = voice ?? throw new ArgumentNullException(nameof(voice)); } /// /// Unique identifier of the business connection on behalf of which the message will be sent /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// [JsonPropertyName(PropertyNames.DirectMessagesTopicId)] public int? DirectMessagesTopicId { get; set; } /// /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Voice)] public object Voice { get; set; } /// /// Voice message caption, 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Mode for parsing entities in the voice message caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Duration of the voice message in seconds /// [JsonPropertyName(PropertyNames.Duration)] public int? Duration { get; set; } /// /// Sends the message silently. Users will receive a notification with no sound. /// [JsonPropertyName(PropertyNames.DisableNotification)] public bool? DisableNotification { get; set; } /// /// Protects the contents of the sent message from forwarding and saving /// [JsonPropertyName(PropertyNames.ProtectContent)] public bool? ProtectContent { get; set; } /// /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// [JsonPropertyName(PropertyNames.AllowPaidBroadcast)] public bool? AllowPaidBroadcast { get; set; } /// /// Unique identifier of the message effect to be added to the message; for private chats only /// [JsonPropertyName(PropertyNames.MessageEffectId)] public string? MessageEffectId { get; set; } /// /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// [JsonPropertyName(PropertyNames.SuggestedPostParameters)] public SuggestedPostParameters? SuggestedPostParameters { get; set; } /// /// Description of the message to reply to /// [JsonPropertyName(PropertyNames.ReplyParameters)] public ReplyParameters? ReplyParameters { get; set; } /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public object? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SetBusinessAccountGiftSettingsArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SetBusinessAccountGiftSettings" method. /// public class SetBusinessAccountGiftSettingsArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier of the business connection /// Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field /// Types of gifts accepted by the business account public SetBusinessAccountGiftSettingsArgs( string businessConnectionId, bool showGiftButton, AcceptedGiftTypes acceptedGiftTypes ) { this.BusinessConnectionId = businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)); this.ShowGiftButton = showGiftButton; this.AcceptedGiftTypes = acceptedGiftTypes ?? throw new ArgumentNullException(nameof(acceptedGiftTypes)); } /// /// Unique identifier of the business connection /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string BusinessConnectionId { get; set; } /// /// Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field /// [JsonPropertyName(PropertyNames.ShowGiftButton)] public bool ShowGiftButton { get; set; } /// /// Types of gifts accepted by the business account /// [JsonPropertyName(PropertyNames.AcceptedGiftTypes)] public AcceptedGiftTypes AcceptedGiftTypes { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SetBusinessAccountProfilePhotoArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SetBusinessAccountProfilePhoto" method. /// public class SetBusinessAccountProfilePhotoArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier of the business connection /// The new profile photo to set public SetBusinessAccountProfilePhotoArgs(string businessConnectionId, InputProfilePhoto photo) { this.BusinessConnectionId = businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Unique identifier of the business connection /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string BusinessConnectionId { get; set; } /// /// The new profile photo to set /// [JsonPropertyName(PropertyNames.Photo)] public InputProfilePhoto Photo { get; set; } /// /// Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo. /// [JsonPropertyName(PropertyNames.IsPublic)] public bool? IsPublic { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SetChatMenuButtonArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SetChatMenuButton" method. /// public class SetChatMenuButtonArgs { /// /// Unique identifier for the target private chat. If not specified, default bot's menu button will be changed /// [JsonPropertyName(PropertyNames.ChatId)] public long? ChatId { get; set; } /// /// A JSON-serialized object for the bot's new menu button. Defaults to /// [JsonPropertyName(PropertyNames.MenuButton)] public MenuButton? MenuButton { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SetChatPermissionsArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SetChatPermissions" method. /// public class SetChatPermissionsArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target supergroup in the format @username /// A JSON-serialized object for new default chat permissions public SetChatPermissionsArgs(long chatId, ChatPermissions permissions) { this.ChatId = chatId; this.Permissions = permissions ?? throw new ArgumentNullException(nameof(permissions)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target supergroup in the format @username /// A JSON-serialized object for new default chat permissions public SetChatPermissionsArgs(string chatId, ChatPermissions permissions) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Permissions = permissions ?? throw new ArgumentNullException(nameof(permissions)); } /// /// Unique identifier for the target chat or username of the target supergroup in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// A JSON-serialized object for new default chat permissions /// [JsonPropertyName(PropertyNames.Permissions)] public ChatPermissions Permissions { get; set; } /// /// Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. /// [JsonPropertyName(PropertyNames.UseIndependentChatPermissions)] public bool? UseIndependentChatPermissions { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SetChatPhotoArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SetChatPhoto" method. /// public class SetChatPhotoArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat photo, uploaded using multipart/form-data public SetChatPhotoArgs(long chatId, InputFile photo) { this.ChatId = chatId; this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat photo, uploaded using multipart/form-data public SetChatPhotoArgs(string chatId, InputFile photo) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Unique identifier for the target chat or username of the target channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// New chat photo, uploaded using multipart/form-data /// [JsonPropertyName(PropertyNames.Photo)] public InputFile Photo { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SetManagedBotAccessSettingsArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SetManagedBotAccessSettings" method. /// public class SetManagedBotAccessSettingsArgs { /// /// Initializes a new instance of the class. /// /// User identifier of the managed bot whose access settings will be changed /// Pass True, if only selected users can access the bot. The bot's owner can always access it. public SetManagedBotAccessSettingsArgs(long userId, bool isAccessRestricted) { this.UserId = userId; this.IsAccessRestricted = isAccessRestricted; } /// /// User identifier of the managed bot whose access settings will be changed /// [JsonPropertyName(PropertyNames.UserId)] public long UserId { get; set; } /// /// Pass True, if only selected users can access the bot. The bot's owner can always access it. /// [JsonPropertyName(PropertyNames.IsAccessRestricted)] public bool IsAccessRestricted { get; set; } /// /// A JSON-serialized list of up to 10 identifiers of users who will have access to the bot in addition to its owner. Ignored if is_access_restricted is false. /// [JsonPropertyName(PropertyNames.AddedUserIds)] public IEnumerable? AddedUserIds { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SetMessageReactionArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SetMessageReaction" method. /// public class SetMessageReactionArgs { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead. public SetMessageReactionArgs(long chatId, int messageId) { this.ChatId = chatId; this.MessageId = messageId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead. public SetMessageReactionArgs(string chatId, int messageId) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.MessageId = messageId; } /// /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead. /// [JsonPropertyName(PropertyNames.MessageId)] public int MessageId { get; set; } /// /// A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots. /// [JsonPropertyName(PropertyNames.Reaction)] public IEnumerable? Reaction { get; set; } /// /// Pass True to set the reaction with a big animation /// [JsonPropertyName(PropertyNames.IsBig)] public bool? IsBig { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SetMyCommandsArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SetMyCommands" method. /// public class SetMyCommandsArgs { /// /// Initializes a new instance of the class. /// /// A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. public SetMyCommandsArgs(IEnumerable commands) { this.Commands = commands ?? throw new ArgumentNullException(nameof(commands)); } /// /// A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. /// [JsonPropertyName(PropertyNames.Commands)] public IEnumerable Commands { get; set; } /// /// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to . /// [JsonPropertyName(PropertyNames.Scope)] public BotCommandScope? Scope { get; set; } /// /// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands /// [JsonPropertyName(PropertyNames.LanguageCode)] public string? LanguageCode { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SetMyDefaultAdministratorRightsArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SetMyDefaultAdministratorRights" method. /// public class SetMyDefaultAdministratorRightsArgs { /// /// A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared. /// [JsonPropertyName(PropertyNames.Rights)] public ChatAdministratorRights? Rights { get; set; } /// /// Pass True to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed. /// [JsonPropertyName(PropertyNames.ForChannels)] public bool? ForChannels { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/Args/SetMyProfilePhotoArgs.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Represents the arguments of the "SetMyProfilePhoto" method. /// public class SetMyProfilePhotoArgs : AttachedFilesArgsBase { /// /// Initializes a new instance of the class. /// /// The new profile photo to set public SetMyProfilePhotoArgs(InputProfilePhoto photo) { this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// The new profile photo to set /// [JsonPropertyName(PropertyNames.Photo)] public InputProfilePhoto Photo { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/answerCallbackQuery.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Games; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned. /// /// The instance. /// The arguments for the "AnswerCallbackQuery" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool AnswerCallbackQuery( this ITelegramBotClient client, AnswerCallbackQueryArgs args ) => client.AnswerCallbackQueryAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned. /// /// The instance. /// The arguments for the "AnswerCallbackQuery" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task AnswerCallbackQueryAsync( this ITelegramBotClient client, AnswerCallbackQueryArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.AnswerCallbackQuery, args, cancellationToken ); } /// /// Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned. /// /// The instance. /// Unique identifier for the query to be answered /// Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters /// If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false. /// URL that will be opened by the user's client. If you have created a and accepted the conditions via @BotFather, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button.

Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. /// The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool AnswerCallbackQuery( this ITelegramBotClient client, string callbackQueryId, string? text = null, bool? showAlert = null, string? url = null, int? cacheTime = null ) => client .AnswerCallbackQueryAsync(callbackQueryId, text, showAlert, url, cacheTime) .GetAwaiter() .GetResult(); /// /// Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned. /// /// The instance. /// Unique identifier for the query to be answered /// Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters /// If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false. /// URL that will be opened by the user's client. If you have created a and accepted the conditions via @BotFather, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button.

Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. /// The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task AnswerCallbackQueryAsync( this ITelegramBotClient client, string callbackQueryId, string? text = null, bool? showAlert = null, string? url = null, int? cacheTime = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.CallbackQueryId, callbackQueryId ?? throw new ArgumentNullException(nameof(callbackQueryId)) }, }; if (text is not null) { args.Add(PropertyNames.Text, text); } if (showAlert is not null) { args.Add(PropertyNames.ShowAlert, showAlert); } if (url is not null) { args.Add(PropertyNames.Url, url); } if (cacheTime is not null) { args.Add(PropertyNames.CacheTime, cacheTime); } return client.CallMethodAsync( MethodNames.AnswerCallbackQuery, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/answerGuestQuery.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.InlineMode; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to reply to a received guest message. On success, a object is returned. /// /// The instance. /// The arguments for the "AnswerGuestQuery" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static SentGuestMessage AnswerGuestQuery( this ITelegramBotClient client, AnswerGuestQueryArgs args ) => client.AnswerGuestQueryAsync(args).GetAwaiter().GetResult(); /// /// Use this method to reply to a received guest message. On success, a object is returned. /// /// The instance. /// The arguments for the "AnswerGuestQuery" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task AnswerGuestQueryAsync( this ITelegramBotClient client, AnswerGuestQueryArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.AnswerGuestQuery, args, cancellationToken ); } /// /// Use this method to reply to a received guest message. On success, a object is returned. /// /// The instance. /// Unique identifier for the query to be answered /// A JSON-serialized object describing the message to be sent /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static SentGuestMessage AnswerGuestQuery( this ITelegramBotClient client, string guestQueryId, InlineQueryResult result ) => client.AnswerGuestQueryAsync(guestQueryId, result).GetAwaiter().GetResult(); /// /// Use this method to reply to a received guest message. On success, a object is returned. /// /// The instance. /// Unique identifier for the query to be answered /// A JSON-serialized object describing the message to be sent /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task AnswerGuestQueryAsync( this ITelegramBotClient client, string guestQueryId, InlineQueryResult result, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.GuestQueryId, guestQueryId ?? throw new ArgumentNullException(nameof(guestQueryId)) }, { PropertyNames.Result, result ?? throw new ArgumentNullException(nameof(result)) }, }; return client.CallMethodAsync( MethodNames.AnswerGuestQuery, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/answerWebAppQuery.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.InlineMode; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a object is returned. /// /// The instance. /// The arguments for the "AnswerWebAppQuery" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static SentWebAppMessage AnswerWebAppQuery( this ITelegramBotClient client, AnswerWebAppQueryArgs args ) => client.AnswerWebAppQueryAsync(args).GetAwaiter().GetResult(); /// /// Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a object is returned. /// /// The instance. /// The arguments for the "AnswerWebAppQuery" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task AnswerWebAppQueryAsync( this ITelegramBotClient client, AnswerWebAppQueryArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.AnswerWebAppQuery, args, cancellationToken ); } /// /// Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a object is returned. /// /// The instance. /// Unique identifier for the query to be answered /// A JSON-serialized object describing the message to be sent /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static SentWebAppMessage AnswerWebAppQuery( this ITelegramBotClient client, string webAppQueryId, InlineQueryResult result ) => client.AnswerWebAppQueryAsync(webAppQueryId, result).GetAwaiter().GetResult(); /// /// Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a object is returned. /// /// The instance. /// Unique identifier for the query to be answered /// A JSON-serialized object describing the message to be sent /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task AnswerWebAppQueryAsync( this ITelegramBotClient client, string webAppQueryId, InlineQueryResult result, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.WebAppQueryId, webAppQueryId ?? throw new ArgumentNullException(nameof(webAppQueryId)) }, { PropertyNames.Result, result ?? throw new ArgumentNullException(nameof(result)) }, }; return client.CallMethodAsync( MethodNames.AnswerWebAppQuery, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/approveChatJoinRequest.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool ApproveChatJoinRequest( this ITelegramBotClient client, long chatId, long userId ) => client.ApproveChatJoinRequestAsync(chatId, userId).GetAwaiter().GetResult(); /// /// Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ApproveChatJoinRequestAsync( this ITelegramBotClient client, long chatId, long userId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.UserId, userId }, }; return client.CallMethodAsync( MethodNames.ApproveChatJoinRequest, args, cancellationToken ); } /// /// Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool ApproveChatJoinRequest( this ITelegramBotClient client, string chatId, long userId ) => client.ApproveChatJoinRequestAsync(chatId, userId).GetAwaiter().GetResult(); /// /// Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ApproveChatJoinRequestAsync( this ITelegramBotClient client, string chatId, long userId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.UserId, userId }, }; return client.CallMethodAsync( MethodNames.ApproveChatJoinRequest, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/banChatMember.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target group or username of the target supergroup or channel in the format @username /// Unique identifier of the target user /// Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. /// Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool BanChatMember( this ITelegramBotClient client, long chatId, long userId, int? untilDate = null, bool? revokeMessages = null ) => client .BanChatMemberAsync(chatId, userId, untilDate, revokeMessages) .GetAwaiter() .GetResult(); /// /// Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target group or username of the target supergroup or channel in the format @username /// Unique identifier of the target user /// Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. /// Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task BanChatMemberAsync( this ITelegramBotClient client, long chatId, long userId, int? untilDate = null, bool? revokeMessages = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.UserId, userId }, }; if (untilDate is not null) { args.Add(PropertyNames.UntilDate, untilDate); } if (revokeMessages is not null) { args.Add(PropertyNames.RevokeMessages, revokeMessages); } return client.CallMethodAsync(MethodNames.BanChatMember, args, cancellationToken); } /// /// Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target group or username of the target supergroup or channel in the format @username /// Unique identifier of the target user /// Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. /// Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool BanChatMember( this ITelegramBotClient client, string chatId, long userId, int? untilDate = null, bool? revokeMessages = null ) => client .BanChatMemberAsync(chatId, userId, untilDate, revokeMessages) .GetAwaiter() .GetResult(); /// /// Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target group or username of the target supergroup or channel in the format @username /// Unique identifier of the target user /// Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. /// Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task BanChatMemberAsync( this ITelegramBotClient client, string chatId, long userId, int? untilDate = null, bool? revokeMessages = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.UserId, userId }, }; if (untilDate is not null) { args.Add(PropertyNames.UntilDate, untilDate); } if (revokeMessages is not null) { args.Add(PropertyNames.RevokeMessages, revokeMessages); } return client.CallMethodAsync(MethodNames.BanChatMember, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/banChatSenderChat.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target sender chat /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool BanChatSenderChat( this ITelegramBotClient client, long chatId, long senderChatId ) => client.BanChatSenderChatAsync(chatId, senderChatId).GetAwaiter().GetResult(); /// /// Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target sender chat /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task BanChatSenderChatAsync( this ITelegramBotClient client, long chatId, long senderChatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.SenderChatId, senderChatId }, }; return client.CallMethodAsync(MethodNames.BanChatSenderChat, args, cancellationToken); } /// /// Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target sender chat /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool BanChatSenderChat( this ITelegramBotClient client, string chatId, long senderChatId ) => client.BanChatSenderChatAsync(chatId, senderChatId).GetAwaiter().GetResult(); /// /// Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target sender chat /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task BanChatSenderChatAsync( this ITelegramBotClient client, string chatId, long senderChatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.SenderChatId, senderChatId }, }; return client.CallMethodAsync(MethodNames.BanChatSenderChat, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/close.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters. /// /// The instance. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool Close(this ITelegramBotClient client) => client.CloseAsync().GetAwaiter().GetResult(); /// /// Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters. /// /// The instance. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CloseAsync( this ITelegramBotClient client, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.Close, cancellationToken: cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/closeForumTopic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool CloseForumTopic( this ITelegramBotClient client, long chatId, int messageThreadId ) => client.CloseForumTopicAsync(chatId, messageThreadId).GetAwaiter().GetResult(); /// /// Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CloseForumTopicAsync( this ITelegramBotClient client, long chatId, int messageThreadId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.MessageThreadId, messageThreadId }, }; return client.CallMethodAsync(MethodNames.CloseForumTopic, args, cancellationToken); } /// /// Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool CloseForumTopic( this ITelegramBotClient client, string chatId, int messageThreadId ) => client.CloseForumTopicAsync(chatId, messageThreadId).GetAwaiter().GetResult(); /// /// Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CloseForumTopicAsync( this ITelegramBotClient client, string chatId, int messageThreadId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.MessageThreadId, messageThreadId }, }; return client.CallMethodAsync(MethodNames.CloseForumTopic, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/closeGeneralForumTopic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool CloseGeneralForumTopic(this ITelegramBotClient client, long chatId) => client.CloseGeneralForumTopicAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CloseGeneralForumTopicAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync( MethodNames.CloseGeneralForumTopic, args, cancellationToken ); } /// /// Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool CloseGeneralForumTopic(this ITelegramBotClient client, string chatId) => client.CloseGeneralForumTopicAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CloseGeneralForumTopicAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync( MethodNames.CloseGeneralForumTopic, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/convertGiftToStars.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Unique identifier of the regular gift that should be converted to Telegram Stars /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool ConvertGiftToStars( this ITelegramBotClient client, string businessConnectionId, string ownedGiftId ) => client.ConvertGiftToStarsAsync(businessConnectionId, ownedGiftId).GetAwaiter().GetResult(); /// /// Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Unique identifier of the regular gift that should be converted to Telegram Stars /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ConvertGiftToStarsAsync( this ITelegramBotClient client, string businessConnectionId, string ownedGiftId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.OwnedGiftId, ownedGiftId ?? throw new ArgumentNullException(nameof(ownedGiftId)) }, }; return client.CallMethodAsync( MethodNames.ConvertGiftToStars, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/copyMessage.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the of the sent message on success. /// /// The instance. /// The arguments for the "CopyMessage" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static MessageId CopyMessage(this ITelegramBotClient client, CopyMessageArgs args) => client.CopyMessageAsync(args).GetAwaiter().GetResult(); /// /// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the of the sent message on success. /// /// The instance. /// The arguments for the "CopyMessage" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CopyMessageAsync( this ITelegramBotClient client, CopyMessageArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.CopyMessage, args, cancellationToken); } /// /// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the of the sent message on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// New start timestamp for the copied video in the message /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept /// Mode for parsing entities in the new caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; only available when copying to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static MessageId CopyMessage( this ITelegramBotClient client, long chatId, long fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .CopyMessageAsync( chatId, fromChatId, messageId, messageThreadId, directMessagesTopicId, videoStartTimestamp, caption, parseMode, captionEntities, showCaptionAboveMedia, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the of the sent message on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// New start timestamp for the copied video in the message /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept /// Mode for parsing entities in the new caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; only available when copying to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CopyMessageAsync( this ITelegramBotClient client, long chatId, long fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.FromChatId, fromChatId }, { PropertyNames.MessageId, messageId }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (videoStartTimestamp is not null) { args.Add(PropertyNames.VideoStartTimestamp, videoStartTimestamp); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.CopyMessage, args, cancellationToken); } /// /// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the of the sent message on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// New start timestamp for the copied video in the message /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept /// Mode for parsing entities in the new caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; only available when copying to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static MessageId CopyMessage( this ITelegramBotClient client, long chatId, string fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .CopyMessageAsync( chatId, fromChatId, messageId, messageThreadId, directMessagesTopicId, videoStartTimestamp, caption, parseMode, captionEntities, showCaptionAboveMedia, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the of the sent message on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// New start timestamp for the copied video in the message /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept /// Mode for parsing entities in the new caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; only available when copying to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CopyMessageAsync( this ITelegramBotClient client, long chatId, string fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.FromChatId, fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)) }, { PropertyNames.MessageId, messageId }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (videoStartTimestamp is not null) { args.Add(PropertyNames.VideoStartTimestamp, videoStartTimestamp); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.CopyMessage, args, cancellationToken); } /// /// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the of the sent message on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// New start timestamp for the copied video in the message /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept /// Mode for parsing entities in the new caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; only available when copying to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static MessageId CopyMessage( this ITelegramBotClient client, string chatId, long fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .CopyMessageAsync( chatId, fromChatId, messageId, messageThreadId, directMessagesTopicId, videoStartTimestamp, caption, parseMode, captionEntities, showCaptionAboveMedia, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the of the sent message on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// New start timestamp for the copied video in the message /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept /// Mode for parsing entities in the new caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; only available when copying to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CopyMessageAsync( this ITelegramBotClient client, string chatId, long fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.FromChatId, fromChatId }, { PropertyNames.MessageId, messageId }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (videoStartTimestamp is not null) { args.Add(PropertyNames.VideoStartTimestamp, videoStartTimestamp); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.CopyMessage, args, cancellationToken); } /// /// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the of the sent message on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// New start timestamp for the copied video in the message /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept /// Mode for parsing entities in the new caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; only available when copying to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static MessageId CopyMessage( this ITelegramBotClient client, string chatId, string fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .CopyMessageAsync( chatId, fromChatId, messageId, messageThreadId, directMessagesTopicId, videoStartTimestamp, caption, parseMode, captionEntities, showCaptionAboveMedia, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the of the sent message on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// New start timestamp for the copied video in the message /// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept /// Mode for parsing entities in the new caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; only available when copying to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CopyMessageAsync( this ITelegramBotClient client, string chatId, string fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.FromChatId, fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)) }, { PropertyNames.MessageId, messageId }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (videoStartTimestamp is not null) { args.Add(PropertyNames.VideoStartTimestamp, videoStartTimestamp); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.CopyMessage, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/copyMessages.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of of the sent messages is returned. /// /// The instance. /// The arguments for the "CopyMessages" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable CopyMessages( this ITelegramBotClient client, CopyMessagesArgs args ) => client.CopyMessagesAsync(args).GetAwaiter().GetResult(); /// /// Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of of the sent messages is returned. /// /// The instance. /// The arguments for the "CopyMessages" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> CopyMessagesAsync( this ITelegramBotClient client, CopyMessagesArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync>( MethodNames.CopyMessages, args, cancellationToken ); } /// /// Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the sent messages from forwarding and saving /// Pass True to copy the messages without their captions /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable CopyMessages( this ITelegramBotClient client, long chatId, long fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, bool? removeCaption = null ) => client .CopyMessagesAsync( chatId, fromChatId, messageIds, messageThreadId, directMessagesTopicId, disableNotification, protectContent, removeCaption ) .GetAwaiter() .GetResult(); /// /// Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the sent messages from forwarding and saving /// Pass True to copy the messages without their captions /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> CopyMessagesAsync( this ITelegramBotClient client, long chatId, long fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, bool? removeCaption = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.FromChatId, fromChatId }, { PropertyNames.MessageIds, messageIds ?? throw new ArgumentNullException(nameof(messageIds)) }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (removeCaption is not null) { args.Add(PropertyNames.RemoveCaption, removeCaption); } return client.CallMethodAsync>( MethodNames.CopyMessages, args, cancellationToken ); } /// /// Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the sent messages from forwarding and saving /// Pass True to copy the messages without their captions /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable CopyMessages( this ITelegramBotClient client, long chatId, string fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, bool? removeCaption = null ) => client .CopyMessagesAsync( chatId, fromChatId, messageIds, messageThreadId, directMessagesTopicId, disableNotification, protectContent, removeCaption ) .GetAwaiter() .GetResult(); /// /// Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the sent messages from forwarding and saving /// Pass True to copy the messages without their captions /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> CopyMessagesAsync( this ITelegramBotClient client, long chatId, string fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, bool? removeCaption = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.FromChatId, fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)) }, { PropertyNames.MessageIds, messageIds ?? throw new ArgumentNullException(nameof(messageIds)) }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (removeCaption is not null) { args.Add(PropertyNames.RemoveCaption, removeCaption); } return client.CallMethodAsync>( MethodNames.CopyMessages, args, cancellationToken ); } /// /// Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the sent messages from forwarding and saving /// Pass True to copy the messages without their captions /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable CopyMessages( this ITelegramBotClient client, string chatId, long fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, bool? removeCaption = null ) => client .CopyMessagesAsync( chatId, fromChatId, messageIds, messageThreadId, directMessagesTopicId, disableNotification, protectContent, removeCaption ) .GetAwaiter() .GetResult(); /// /// Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the sent messages from forwarding and saving /// Pass True to copy the messages without their captions /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> CopyMessagesAsync( this ITelegramBotClient client, string chatId, long fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, bool? removeCaption = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.FromChatId, fromChatId }, { PropertyNames.MessageIds, messageIds ?? throw new ArgumentNullException(nameof(messageIds)) }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (removeCaption is not null) { args.Add(PropertyNames.RemoveCaption, removeCaption); } return client.CallMethodAsync>( MethodNames.CopyMessages, args, cancellationToken ); } /// /// Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the sent messages from forwarding and saving /// Pass True to copy the messages without their captions /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable CopyMessages( this ITelegramBotClient client, string chatId, string fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, bool? removeCaption = null ) => client .CopyMessagesAsync( chatId, fromChatId, messageIds, messageThreadId, directMessagesTopicId, disableNotification, protectContent, removeCaption ) .GetAwaiter() .GetResult(); /// /// Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the sent messages from forwarding and saving /// Pass True to copy the messages without their captions /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> CopyMessagesAsync( this ITelegramBotClient client, string chatId, string fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, bool? removeCaption = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.FromChatId, fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)) }, { PropertyNames.MessageIds, messageIds ?? throw new ArgumentNullException(nameof(messageIds)) }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (removeCaption is not null) { args.Add(PropertyNames.RemoveCaption, removeCaption); } return client.CallMethodAsync>( MethodNames.CopyMessages, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/createChatInviteLink.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as object. /// /// The instance. /// The arguments for the "CreateChatInviteLink" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatInviteLink CreateChatInviteLink( this ITelegramBotClient client, CreateChatInviteLinkArgs args ) => client.CreateChatInviteLinkAsync(args).GetAwaiter().GetResult(); /// /// Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as object. /// /// The instance. /// The arguments for the "CreateChatInviteLink" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CreateChatInviteLinkAsync( this ITelegramBotClient client, CreateChatInviteLinkArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.CreateChatInviteLink, args, cancellationToken ); } /// /// Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as object. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Invite link name; 0-32 characters /// Point in time (Unix timestamp) when the link will expire /// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 /// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatInviteLink CreateChatInviteLink( this ITelegramBotClient client, long chatId, string? name = null, int? expireDate = null, int? memberLimit = null, bool? createsJoinRequest = null ) => client .CreateChatInviteLinkAsync(chatId, name, expireDate, memberLimit, createsJoinRequest) .GetAwaiter() .GetResult(); /// /// Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as object. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Invite link name; 0-32 characters /// Point in time (Unix timestamp) when the link will expire /// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 /// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CreateChatInviteLinkAsync( this ITelegramBotClient client, long chatId, string? name = null, int? expireDate = null, int? memberLimit = null, bool? createsJoinRequest = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; if (name is not null) { args.Add(PropertyNames.Name, name); } if (expireDate is not null) { args.Add(PropertyNames.ExpireDate, expireDate); } if (memberLimit is not null) { args.Add(PropertyNames.MemberLimit, memberLimit); } if (createsJoinRequest is not null) { args.Add(PropertyNames.CreatesJoinRequest, createsJoinRequest); } return client.CallMethodAsync( MethodNames.CreateChatInviteLink, args, cancellationToken ); } /// /// Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as object. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Invite link name; 0-32 characters /// Point in time (Unix timestamp) when the link will expire /// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 /// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatInviteLink CreateChatInviteLink( this ITelegramBotClient client, string chatId, string? name = null, int? expireDate = null, int? memberLimit = null, bool? createsJoinRequest = null ) => client .CreateChatInviteLinkAsync(chatId, name, expireDate, memberLimit, createsJoinRequest) .GetAwaiter() .GetResult(); /// /// Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as object. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Invite link name; 0-32 characters /// Point in time (Unix timestamp) when the link will expire /// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 /// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CreateChatInviteLinkAsync( this ITelegramBotClient client, string chatId, string? name = null, int? expireDate = null, int? memberLimit = null, bool? createsJoinRequest = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; if (name is not null) { args.Add(PropertyNames.Name, name); } if (expireDate is not null) { args.Add(PropertyNames.ExpireDate, expireDate); } if (memberLimit is not null) { args.Add(PropertyNames.MemberLimit, memberLimit); } if (createsJoinRequest is not null) { args.Add(PropertyNames.CreatesJoinRequest, createsJoinRequest); } return client.CallMethodAsync( MethodNames.CreateChatInviteLink, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/createChatSubscriptionInviteLink.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a object. /// /// The instance. /// Unique identifier for the target channel chat or username of the target channel in the format @username /// The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). /// The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000 /// Invite link name; 0-32 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatInviteLink CreateChatSubscriptionInviteLink( this ITelegramBotClient client, long chatId, int subscriptionPeriod, int subscriptionPrice, string? name = null ) => client .CreateChatSubscriptionInviteLinkAsync( chatId, subscriptionPeriod, subscriptionPrice, name ) .GetAwaiter() .GetResult(); /// /// Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a object. /// /// The instance. /// Unique identifier for the target channel chat or username of the target channel in the format @username /// The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). /// The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000 /// Invite link name; 0-32 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CreateChatSubscriptionInviteLinkAsync( this ITelegramBotClient client, long chatId, int subscriptionPeriod, int subscriptionPrice, string? name = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.SubscriptionPeriod, subscriptionPeriod }, { PropertyNames.SubscriptionPrice, subscriptionPrice }, }; if (name is not null) { args.Add(PropertyNames.Name, name); } return client.CallMethodAsync( MethodNames.CreateChatSubscriptionInviteLink, args, cancellationToken ); } /// /// Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a object. /// /// The instance. /// Unique identifier for the target channel chat or username of the target channel in the format @username /// The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). /// The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000 /// Invite link name; 0-32 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatInviteLink CreateChatSubscriptionInviteLink( this ITelegramBotClient client, string chatId, int subscriptionPeriod, int subscriptionPrice, string? name = null ) => client .CreateChatSubscriptionInviteLinkAsync( chatId, subscriptionPeriod, subscriptionPrice, name ) .GetAwaiter() .GetResult(); /// /// Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a object. /// /// The instance. /// Unique identifier for the target channel chat or username of the target channel in the format @username /// The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). /// The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000 /// Invite link name; 0-32 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CreateChatSubscriptionInviteLinkAsync( this ITelegramBotClient client, string chatId, int subscriptionPeriod, int subscriptionPrice, string? name = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.SubscriptionPeriod, subscriptionPeriod }, { PropertyNames.SubscriptionPrice, subscriptionPrice }, }; if (name is not null) { args.Add(PropertyNames.Name, name); } return client.CallMethodAsync( MethodNames.CreateChatSubscriptionInviteLink, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/createForumTopic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a object. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Topic name, 1-128 characters /// Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F) /// Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ForumTopic CreateForumTopic( this ITelegramBotClient client, long chatId, string name, int? iconColor = null, string? iconCustomEmojiId = null ) => client .CreateForumTopicAsync(chatId, name, iconColor, iconCustomEmojiId) .GetAwaiter() .GetResult(); /// /// Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a object. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Topic name, 1-128 characters /// Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F) /// Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CreateForumTopicAsync( this ITelegramBotClient client, long chatId, string name, int? iconColor = null, string? iconCustomEmojiId = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Name, name ?? throw new ArgumentNullException(nameof(name)) }, }; if (iconColor is not null) { args.Add(PropertyNames.IconColor, iconColor); } if (iconCustomEmojiId is not null) { args.Add(PropertyNames.IconCustomEmojiId, iconCustomEmojiId); } return client.CallMethodAsync( MethodNames.CreateForumTopic, args, cancellationToken ); } /// /// Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a object. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Topic name, 1-128 characters /// Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F) /// Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ForumTopic CreateForumTopic( this ITelegramBotClient client, string chatId, string name, int? iconColor = null, string? iconCustomEmojiId = null ) => client .CreateForumTopicAsync(chatId, name, iconColor, iconCustomEmojiId) .GetAwaiter() .GetResult(); /// /// Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a object. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Topic name, 1-128 characters /// Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F) /// Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task CreateForumTopicAsync( this ITelegramBotClient client, string chatId, string name, int? iconColor = null, string? iconCustomEmojiId = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Name, name ?? throw new ArgumentNullException(nameof(name)) }, }; if (iconColor is not null) { args.Add(PropertyNames.IconColor, iconColor); } if (iconCustomEmojiId is not null) { args.Add(PropertyNames.IconCustomEmojiId, iconCustomEmojiId); } return client.CallMethodAsync( MethodNames.CreateForumTopic, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/declineChatJoinRequest.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeclineChatJoinRequest( this ITelegramBotClient client, long chatId, long userId ) => client.DeclineChatJoinRequestAsync(chatId, userId).GetAwaiter().GetResult(); /// /// Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeclineChatJoinRequestAsync( this ITelegramBotClient client, long chatId, long userId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.UserId, userId }, }; return client.CallMethodAsync( MethodNames.DeclineChatJoinRequest, args, cancellationToken ); } /// /// Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeclineChatJoinRequest( this ITelegramBotClient client, string chatId, long userId ) => client.DeclineChatJoinRequestAsync(chatId, userId).GetAwaiter().GetResult(); /// /// Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeclineChatJoinRequestAsync( this ITelegramBotClient client, string chatId, long userId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.UserId, userId }, }; return client.CallMethodAsync( MethodNames.DeclineChatJoinRequest, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/deleteBusinessMessages.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Delete messages on behalf of a business account. Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success. /// /// The instance. /// The arguments for the "DeleteBusinessMessages" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeleteBusinessMessages( this ITelegramBotClient client, DeleteBusinessMessagesArgs args ) => client.DeleteBusinessMessagesAsync(args).GetAwaiter().GetResult(); /// /// Delete messages on behalf of a business account. Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success. /// /// The instance. /// The arguments for the "DeleteBusinessMessages" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeleteBusinessMessagesAsync( this ITelegramBotClient client, DeleteBusinessMessagesArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.DeleteBusinessMessages, args, cancellationToken ); } /// /// Delete messages on behalf of a business account. Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success. /// /// The instance. /// Unique identifier of the business connection on behalf of which to delete the messages /// A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeleteBusinessMessages( this ITelegramBotClient client, string businessConnectionId, IEnumerable messageIds ) => client .DeleteBusinessMessagesAsync(businessConnectionId, messageIds) .GetAwaiter() .GetResult(); /// /// Delete messages on behalf of a business account. Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success. /// /// The instance. /// Unique identifier of the business connection on behalf of which to delete the messages /// A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeleteBusinessMessagesAsync( this ITelegramBotClient client, string businessConnectionId, IEnumerable messageIds, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.MessageIds, messageIds ?? throw new ArgumentNullException(nameof(messageIds)) }, }; return client.CallMethodAsync( MethodNames.DeleteBusinessMessages, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/deleteChatPhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeleteChatPhoto(this ITelegramBotClient client, long chatId) => client.DeleteChatPhotoAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeleteChatPhotoAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync(MethodNames.DeleteChatPhoto, args, cancellationToken); } /// /// Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeleteChatPhoto(this ITelegramBotClient client, string chatId) => client.DeleteChatPhotoAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeleteChatPhotoAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync(MethodNames.DeleteChatPhoto, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/deleteChatStickerSet.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeleteChatStickerSet(this ITelegramBotClient client, long chatId) => client.DeleteChatStickerSetAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeleteChatStickerSetAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync( MethodNames.DeleteChatStickerSet, args, cancellationToken ); } /// /// Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeleteChatStickerSet(this ITelegramBotClient client, string chatId) => client.DeleteChatStickerSetAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeleteChatStickerSetAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync( MethodNames.DeleteChatStickerSet, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/deleteForumTopic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeleteForumTopic( this ITelegramBotClient client, long chatId, int messageThreadId ) => client.DeleteForumTopicAsync(chatId, messageThreadId).GetAwaiter().GetResult(); /// /// Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeleteForumTopicAsync( this ITelegramBotClient client, long chatId, int messageThreadId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.MessageThreadId, messageThreadId }, }; return client.CallMethodAsync(MethodNames.DeleteForumTopic, args, cancellationToken); } /// /// Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeleteForumTopic( this ITelegramBotClient client, string chatId, int messageThreadId ) => client.DeleteForumTopicAsync(chatId, messageThreadId).GetAwaiter().GetResult(); /// /// Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeleteForumTopicAsync( this ITelegramBotClient client, string chatId, int messageThreadId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.MessageThreadId, messageThreadId }, }; return client.CallMethodAsync(MethodNames.DeleteForumTopic, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/deleteMyCommands.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success. /// /// The instance. /// The arguments for the "DeleteMyCommands" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeleteMyCommands( this ITelegramBotClient client, DeleteMyCommandsArgs args ) => client.DeleteMyCommandsAsync(args).GetAwaiter().GetResult(); /// /// Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success. /// /// The instance. /// The arguments for the "DeleteMyCommands" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeleteMyCommandsAsync( this ITelegramBotClient client, DeleteMyCommandsArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.DeleteMyCommands, args, cancellationToken); } /// /// Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success. /// /// The instance. /// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to . /// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeleteMyCommands( this ITelegramBotClient client, BotCommandScope? scope = null, string? languageCode = null ) => client.DeleteMyCommandsAsync(scope, languageCode).GetAwaiter().GetResult(); /// /// Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success. /// /// The instance. /// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to . /// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeleteMyCommandsAsync( this ITelegramBotClient client, BotCommandScope? scope = null, string? languageCode = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { }; if (scope is not null) { args.Add(PropertyNames.Scope, scope); } if (languageCode is not null) { args.Add(PropertyNames.LanguageCode, languageCode); } return client.CallMethodAsync(MethodNames.DeleteMyCommands, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/deleteStory.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Unique identifier of the story to delete /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool DeleteStory( this ITelegramBotClient client, string businessConnectionId, int storyId ) => client.DeleteStoryAsync(businessConnectionId, storyId).GetAwaiter().GetResult(); /// /// Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Unique identifier of the story to delete /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task DeleteStoryAsync( this ITelegramBotClient client, string businessConnectionId, int storyId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.StoryId, storyId }, }; return client.CallMethodAsync(MethodNames.DeleteStory, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/editChatInviteLink.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a object. /// /// The instance. /// The arguments for the "EditChatInviteLink" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatInviteLink EditChatInviteLink( this ITelegramBotClient client, EditChatInviteLinkArgs args ) => client.EditChatInviteLinkAsync(args).GetAwaiter().GetResult(); /// /// Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a object. /// /// The instance. /// The arguments for the "EditChatInviteLink" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task EditChatInviteLinkAsync( this ITelegramBotClient client, EditChatInviteLinkArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.EditChatInviteLink, args, cancellationToken ); } /// /// Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a object. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The invite link to edit /// Invite link name; 0-32 characters /// Point in time (Unix timestamp) when the link will expire /// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 /// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatInviteLink EditChatInviteLink( this ITelegramBotClient client, long chatId, string inviteLink, string? name = null, int? expireDate = null, int? memberLimit = null, bool? createsJoinRequest = null ) => client .EditChatInviteLinkAsync( chatId, inviteLink, name, expireDate, memberLimit, createsJoinRequest ) .GetAwaiter() .GetResult(); /// /// Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a object. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The invite link to edit /// Invite link name; 0-32 characters /// Point in time (Unix timestamp) when the link will expire /// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 /// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task EditChatInviteLinkAsync( this ITelegramBotClient client, long chatId, string inviteLink, string? name = null, int? expireDate = null, int? memberLimit = null, bool? createsJoinRequest = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.InviteLink, inviteLink ?? throw new ArgumentNullException(nameof(inviteLink)) }, }; if (name is not null) { args.Add(PropertyNames.Name, name); } if (expireDate is not null) { args.Add(PropertyNames.ExpireDate, expireDate); } if (memberLimit is not null) { args.Add(PropertyNames.MemberLimit, memberLimit); } if (createsJoinRequest is not null) { args.Add(PropertyNames.CreatesJoinRequest, createsJoinRequest); } return client.CallMethodAsync( MethodNames.EditChatInviteLink, args, cancellationToken ); } /// /// Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a object. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The invite link to edit /// Invite link name; 0-32 characters /// Point in time (Unix timestamp) when the link will expire /// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 /// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatInviteLink EditChatInviteLink( this ITelegramBotClient client, string chatId, string inviteLink, string? name = null, int? expireDate = null, int? memberLimit = null, bool? createsJoinRequest = null ) => client .EditChatInviteLinkAsync( chatId, inviteLink, name, expireDate, memberLimit, createsJoinRequest ) .GetAwaiter() .GetResult(); /// /// Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a object. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The invite link to edit /// Invite link name; 0-32 characters /// Point in time (Unix timestamp) when the link will expire /// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 /// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task EditChatInviteLinkAsync( this ITelegramBotClient client, string chatId, string inviteLink, string? name = null, int? expireDate = null, int? memberLimit = null, bool? createsJoinRequest = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.InviteLink, inviteLink ?? throw new ArgumentNullException(nameof(inviteLink)) }, }; if (name is not null) { args.Add(PropertyNames.Name, name); } if (expireDate is not null) { args.Add(PropertyNames.ExpireDate, expireDate); } if (memberLimit is not null) { args.Add(PropertyNames.MemberLimit, memberLimit); } if (createsJoinRequest is not null) { args.Add(PropertyNames.CreatesJoinRequest, createsJoinRequest); } return client.CallMethodAsync( MethodNames.EditChatInviteLink, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/editChatSubscriptionInviteLink.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a object. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The invite link to edit /// Invite link name; 0-32 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatInviteLink EditChatSubscriptionInviteLink( this ITelegramBotClient client, long chatId, string inviteLink, string? name = null ) => client .EditChatSubscriptionInviteLinkAsync(chatId, inviteLink, name) .GetAwaiter() .GetResult(); /// /// Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a object. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The invite link to edit /// Invite link name; 0-32 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task EditChatSubscriptionInviteLinkAsync( this ITelegramBotClient client, long chatId, string inviteLink, string? name = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.InviteLink, inviteLink ?? throw new ArgumentNullException(nameof(inviteLink)) }, }; if (name is not null) { args.Add(PropertyNames.Name, name); } return client.CallMethodAsync( MethodNames.EditChatSubscriptionInviteLink, args, cancellationToken ); } /// /// Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a object. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The invite link to edit /// Invite link name; 0-32 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatInviteLink EditChatSubscriptionInviteLink( this ITelegramBotClient client, string chatId, string inviteLink, string? name = null ) => client .EditChatSubscriptionInviteLinkAsync(chatId, inviteLink, name) .GetAwaiter() .GetResult(); /// /// Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a object. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The invite link to edit /// Invite link name; 0-32 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task EditChatSubscriptionInviteLinkAsync( this ITelegramBotClient client, string chatId, string inviteLink, string? name = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.InviteLink, inviteLink ?? throw new ArgumentNullException(nameof(inviteLink)) }, }; if (name is not null) { args.Add(PropertyNames.Name, name); } return client.CallMethodAsync( MethodNames.EditChatSubscriptionInviteLink, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/editForumTopic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept /// New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool EditForumTopic( this ITelegramBotClient client, long chatId, int messageThreadId, string? name = null, string? iconCustomEmojiId = null ) => client .EditForumTopicAsync(chatId, messageThreadId, name, iconCustomEmojiId) .GetAwaiter() .GetResult(); /// /// Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept /// New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task EditForumTopicAsync( this ITelegramBotClient client, long chatId, int messageThreadId, string? name = null, string? iconCustomEmojiId = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.MessageThreadId, messageThreadId }, }; if (name is not null) { args.Add(PropertyNames.Name, name); } if (iconCustomEmojiId is not null) { args.Add(PropertyNames.IconCustomEmojiId, iconCustomEmojiId); } return client.CallMethodAsync(MethodNames.EditForumTopic, args, cancellationToken); } /// /// Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept /// New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool EditForumTopic( this ITelegramBotClient client, string chatId, int messageThreadId, string? name = null, string? iconCustomEmojiId = null ) => client .EditForumTopicAsync(chatId, messageThreadId, name, iconCustomEmojiId) .GetAwaiter() .GetResult(); /// /// Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept /// New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task EditForumTopicAsync( this ITelegramBotClient client, string chatId, int messageThreadId, string? name = null, string? iconCustomEmojiId = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.MessageThreadId, messageThreadId }, }; if (name is not null) { args.Add(PropertyNames.Name, name); } if (iconCustomEmojiId is not null) { args.Add(PropertyNames.IconCustomEmojiId, iconCustomEmojiId); } return client.CallMethodAsync(MethodNames.EditForumTopic, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/editGeneralForumTopic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// New topic name, 1-128 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool EditGeneralForumTopic( this ITelegramBotClient client, long chatId, string name ) => client.EditGeneralForumTopicAsync(chatId, name).GetAwaiter().GetResult(); /// /// Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// New topic name, 1-128 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task EditGeneralForumTopicAsync( this ITelegramBotClient client, long chatId, string name, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Name, name ?? throw new ArgumentNullException(nameof(name)) }, }; return client.CallMethodAsync( MethodNames.EditGeneralForumTopic, args, cancellationToken ); } /// /// Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// New topic name, 1-128 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool EditGeneralForumTopic( this ITelegramBotClient client, string chatId, string name ) => client.EditGeneralForumTopicAsync(chatId, name).GetAwaiter().GetResult(); /// /// Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// New topic name, 1-128 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task EditGeneralForumTopicAsync( this ITelegramBotClient client, string chatId, string name, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Name, name ?? throw new ArgumentNullException(nameof(name)) }, }; return client.CallMethodAsync( MethodNames.EditGeneralForumTopic, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/editStory.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns on success. /// /// The instance. /// The arguments for the "EditStory" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Story EditStory(this ITelegramBotClient client, EditStoryArgs args) => client.EditStoryAsync(args).GetAwaiter().GetResult(); /// /// Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns on success. /// /// The instance. /// The arguments for the "EditStory" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task EditStoryAsync( this ITelegramBotClient client, EditStoryArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.EditStory, args, cancellationToken); } /// /// Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns on success. /// /// The instance. /// Unique identifier of the business connection /// Unique identifier of the story to edit /// Content of the story /// Caption of the story, 0-2048 characters after entities parsing /// Mode for parsing entities in the story caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// A JSON-serialized list of clickable areas to be shown on the story /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Story EditStory( this ITelegramBotClient client, string businessConnectionId, int storyId, InputStoryContent content, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, IEnumerable? areas = null ) => client .EditStoryAsync( businessConnectionId, storyId, content, caption, parseMode, captionEntities, areas ) .GetAwaiter() .GetResult(); /// /// Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns on success. /// /// The instance. /// Unique identifier of the business connection /// Unique identifier of the story to edit /// Content of the story /// Caption of the story, 0-2048 characters after entities parsing /// Mode for parsing entities in the story caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// A JSON-serialized list of clickable areas to be shown on the story /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task EditStoryAsync( this ITelegramBotClient client, string businessConnectionId, int storyId, InputStoryContent content, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, IEnumerable? areas = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.StoryId, storyId }, { PropertyNames.Content, content ?? throw new ArgumentNullException(nameof(content)) }, }; if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (areas is not null) { args.Add(PropertyNames.Areas, areas); } return client.CallMethodAsync(MethodNames.EditStory, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/exportChatInviteLink.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static string ExportChatInviteLink(this ITelegramBotClient client, long chatId) => client.ExportChatInviteLinkAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ExportChatInviteLinkAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync( MethodNames.ExportChatInviteLink, args, cancellationToken ); } /// /// Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static string ExportChatInviteLink(this ITelegramBotClient client, string chatId) => client.ExportChatInviteLinkAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ExportChatInviteLinkAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync( MethodNames.ExportChatInviteLink, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/forwardMessage.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent is returned. /// /// The instance. /// The arguments for the "ForwardMessage" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message ForwardMessage(this ITelegramBotClient client, ForwardMessageArgs args) => client.ForwardMessageAsync(args).GetAwaiter().GetResult(); /// /// Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent is returned. /// /// The instance. /// The arguments for the "ForwardMessage" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ForwardMessageAsync( this ITelegramBotClient client, ForwardMessageArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.ForwardMessage, args, cancellationToken); } /// /// Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat /// New start timestamp for the forwarded video in the message /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded message from forwarding and saving /// Unique identifier of the message effect to be added to the message; only available when forwarding to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message ForwardMessage( this ITelegramBotClient client, long chatId, long fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, bool? disableNotification = null, bool? protectContent = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null ) => client .ForwardMessageAsync( chatId, fromChatId, messageId, messageThreadId, directMessagesTopicId, videoStartTimestamp, disableNotification, protectContent, messageEffectId, suggestedPostParameters ) .GetAwaiter() .GetResult(); /// /// Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat /// New start timestamp for the forwarded video in the message /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded message from forwarding and saving /// Unique identifier of the message effect to be added to the message; only available when forwarding to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ForwardMessageAsync( this ITelegramBotClient client, long chatId, long fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, bool? disableNotification = null, bool? protectContent = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.FromChatId, fromChatId }, { PropertyNames.MessageId, messageId }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (videoStartTimestamp is not null) { args.Add(PropertyNames.VideoStartTimestamp, videoStartTimestamp); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } return client.CallMethodAsync(MethodNames.ForwardMessage, args, cancellationToken); } /// /// Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat /// New start timestamp for the forwarded video in the message /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded message from forwarding and saving /// Unique identifier of the message effect to be added to the message; only available when forwarding to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message ForwardMessage( this ITelegramBotClient client, long chatId, string fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, bool? disableNotification = null, bool? protectContent = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null ) => client .ForwardMessageAsync( chatId, fromChatId, messageId, messageThreadId, directMessagesTopicId, videoStartTimestamp, disableNotification, protectContent, messageEffectId, suggestedPostParameters ) .GetAwaiter() .GetResult(); /// /// Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat /// New start timestamp for the forwarded video in the message /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded message from forwarding and saving /// Unique identifier of the message effect to be added to the message; only available when forwarding to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ForwardMessageAsync( this ITelegramBotClient client, long chatId, string fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, bool? disableNotification = null, bool? protectContent = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.FromChatId, fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)) }, { PropertyNames.MessageId, messageId }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (videoStartTimestamp is not null) { args.Add(PropertyNames.VideoStartTimestamp, videoStartTimestamp); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } return client.CallMethodAsync(MethodNames.ForwardMessage, args, cancellationToken); } /// /// Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat /// New start timestamp for the forwarded video in the message /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded message from forwarding and saving /// Unique identifier of the message effect to be added to the message; only available when forwarding to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message ForwardMessage( this ITelegramBotClient client, string chatId, long fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, bool? disableNotification = null, bool? protectContent = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null ) => client .ForwardMessageAsync( chatId, fromChatId, messageId, messageThreadId, directMessagesTopicId, videoStartTimestamp, disableNotification, protectContent, messageEffectId, suggestedPostParameters ) .GetAwaiter() .GetResult(); /// /// Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat /// New start timestamp for the forwarded video in the message /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded message from forwarding and saving /// Unique identifier of the message effect to be added to the message; only available when forwarding to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ForwardMessageAsync( this ITelegramBotClient client, string chatId, long fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, bool? disableNotification = null, bool? protectContent = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.FromChatId, fromChatId }, { PropertyNames.MessageId, messageId }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (videoStartTimestamp is not null) { args.Add(PropertyNames.VideoStartTimestamp, videoStartTimestamp); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } return client.CallMethodAsync(MethodNames.ForwardMessage, args, cancellationToken); } /// /// Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat /// New start timestamp for the forwarded video in the message /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded message from forwarding and saving /// Unique identifier of the message effect to be added to the message; only available when forwarding to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message ForwardMessage( this ITelegramBotClient client, string chatId, string fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, bool? disableNotification = null, bool? protectContent = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null ) => client .ForwardMessageAsync( chatId, fromChatId, messageId, messageThreadId, directMessagesTopicId, videoStartTimestamp, disableNotification, protectContent, messageEffectId, suggestedPostParameters ) .GetAwaiter() .GetResult(); /// /// Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) /// Message identifier in the chat specified in from_chat_id /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat /// New start timestamp for the forwarded video in the message /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded message from forwarding and saving /// Unique identifier of the message effect to be added to the message; only available when forwarding to private chats /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ForwardMessageAsync( this ITelegramBotClient client, string chatId, string fromChatId, int messageId, int? messageThreadId = null, int? directMessagesTopicId = null, int? videoStartTimestamp = null, bool? disableNotification = null, bool? protectContent = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.FromChatId, fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)) }, { PropertyNames.MessageId, messageId }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (videoStartTimestamp is not null) { args.Add(PropertyNames.VideoStartTimestamp, videoStartTimestamp); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } return client.CallMethodAsync(MethodNames.ForwardMessage, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/forwardMessages.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of of the sent messages is returned. /// /// The instance. /// The arguments for the "ForwardMessages" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable ForwardMessages( this ITelegramBotClient client, ForwardMessagesArgs args ) => client.ForwardMessagesAsync(args).GetAwaiter().GetResult(); /// /// Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of of the sent messages is returned. /// /// The instance. /// The arguments for the "ForwardMessages" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> ForwardMessagesAsync( this ITelegramBotClient client, ForwardMessagesArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync>( MethodNames.ForwardMessages, args, cancellationToken ); } /// /// Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded messages from forwarding and saving /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable ForwardMessages( this ITelegramBotClient client, long chatId, long fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null ) => client .ForwardMessagesAsync( chatId, fromChatId, messageIds, messageThreadId, directMessagesTopicId, disableNotification, protectContent ) .GetAwaiter() .GetResult(); /// /// Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded messages from forwarding and saving /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> ForwardMessagesAsync( this ITelegramBotClient client, long chatId, long fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.FromChatId, fromChatId }, { PropertyNames.MessageIds, messageIds ?? throw new ArgumentNullException(nameof(messageIds)) }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } return client.CallMethodAsync>( MethodNames.ForwardMessages, args, cancellationToken ); } /// /// Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded messages from forwarding and saving /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable ForwardMessages( this ITelegramBotClient client, long chatId, string fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null ) => client .ForwardMessagesAsync( chatId, fromChatId, messageIds, messageThreadId, directMessagesTopicId, disableNotification, protectContent ) .GetAwaiter() .GetResult(); /// /// Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded messages from forwarding and saving /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> ForwardMessagesAsync( this ITelegramBotClient client, long chatId, string fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.FromChatId, fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)) }, { PropertyNames.MessageIds, messageIds ?? throw new ArgumentNullException(nameof(messageIds)) }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } return client.CallMethodAsync>( MethodNames.ForwardMessages, args, cancellationToken ); } /// /// Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded messages from forwarding and saving /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable ForwardMessages( this ITelegramBotClient client, string chatId, long fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null ) => client .ForwardMessagesAsync( chatId, fromChatId, messageIds, messageThreadId, directMessagesTopicId, disableNotification, protectContent ) .GetAwaiter() .GetResult(); /// /// Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded messages from forwarding and saving /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> ForwardMessagesAsync( this ITelegramBotClient client, string chatId, long fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.FromChatId, fromChatId }, { PropertyNames.MessageIds, messageIds ?? throw new ArgumentNullException(nameof(messageIds)) }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } return client.CallMethodAsync>( MethodNames.ForwardMessages, args, cancellationToken ); } /// /// Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded messages from forwarding and saving /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable ForwardMessages( this ITelegramBotClient client, string chatId, string fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null ) => client .ForwardMessagesAsync( chatId, fromChatId, messageIds, messageThreadId, directMessagesTopicId, disableNotification, protectContent ) .GetAwaiter() .GetResult(); /// /// Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of of the sent messages is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup or channel in the format @username) /// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat /// Sends the messages silently. Users will receive a notification with no sound. /// Protects the contents of the forwarded messages from forwarding and saving /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> ForwardMessagesAsync( this ITelegramBotClient client, string chatId, string fromChatId, IEnumerable messageIds, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.FromChatId, fromChatId ?? throw new ArgumentNullException(nameof(fromChatId)) }, { PropertyNames.MessageIds, messageIds ?? throw new ArgumentNullException(nameof(messageIds)) }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } return client.CallMethodAsync>( MethodNames.ForwardMessages, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getAvailableGifts.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a object. /// /// The instance. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Gifts GetAvailableGifts(this ITelegramBotClient client) => client.GetAvailableGiftsAsync().GetAwaiter().GetResult(); /// /// Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a object. /// /// The instance. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetAvailableGiftsAsync( this ITelegramBotClient client, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.GetAvailableGifts, cancellationToken: cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getBusinessAccountGifts.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns on success. /// /// The instance. /// The arguments for the "GetBusinessAccountGifts" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static OwnedGifts GetBusinessAccountGifts( this ITelegramBotClient client, GetBusinessAccountGiftsArgs args ) => client.GetBusinessAccountGiftsAsync(args).GetAwaiter().GetResult(); /// /// Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns on success. /// /// The instance. /// The arguments for the "GetBusinessAccountGifts" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetBusinessAccountGiftsAsync( this ITelegramBotClient client, GetBusinessAccountGiftsArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.GetBusinessAccountGifts, args, cancellationToken ); } /// /// Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns on success. /// /// The instance. /// Unique identifier of the business connection /// Pass True to exclude gifts that aren't saved to the account's profile page /// Pass True to exclude gifts that are saved to the account's profile page /// Pass True to exclude gifts that can be purchased an unlimited number of times /// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique /// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique /// Pass True to exclude unique gifts /// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram /// Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. /// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results /// The maximum number of gifts to be returned; 1-100. Defaults to 100 /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static OwnedGifts GetBusinessAccountGifts( this ITelegramBotClient client, string businessConnectionId, bool? excludeUnsaved = null, bool? excludeSaved = null, bool? excludeUnlimited = null, bool? excludeLimitedUpgradable = null, bool? excludeLimitedNonUpgradable = null, bool? excludeUnique = null, bool? excludeFromBlockchain = null, bool? sortByPrice = null, string? offset = null, int? limit = null ) => client .GetBusinessAccountGiftsAsync( businessConnectionId, excludeUnsaved, excludeSaved, excludeUnlimited, excludeLimitedUpgradable, excludeLimitedNonUpgradable, excludeUnique, excludeFromBlockchain, sortByPrice, offset, limit ) .GetAwaiter() .GetResult(); /// /// Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns on success. /// /// The instance. /// Unique identifier of the business connection /// Pass True to exclude gifts that aren't saved to the account's profile page /// Pass True to exclude gifts that are saved to the account's profile page /// Pass True to exclude gifts that can be purchased an unlimited number of times /// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique /// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique /// Pass True to exclude unique gifts /// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram /// Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. /// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results /// The maximum number of gifts to be returned; 1-100. Defaults to 100 /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetBusinessAccountGiftsAsync( this ITelegramBotClient client, string businessConnectionId, bool? excludeUnsaved = null, bool? excludeSaved = null, bool? excludeUnlimited = null, bool? excludeLimitedUpgradable = null, bool? excludeLimitedNonUpgradable = null, bool? excludeUnique = null, bool? excludeFromBlockchain = null, bool? sortByPrice = null, string? offset = null, int? limit = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, }; if (excludeUnsaved is not null) { args.Add(PropertyNames.ExcludeUnsaved, excludeUnsaved); } if (excludeSaved is not null) { args.Add(PropertyNames.ExcludeSaved, excludeSaved); } if (excludeUnlimited is not null) { args.Add(PropertyNames.ExcludeUnlimited, excludeUnlimited); } if (excludeLimitedUpgradable is not null) { args.Add(PropertyNames.ExcludeLimitedUpgradable, excludeLimitedUpgradable); } if (excludeLimitedNonUpgradable is not null) { args.Add(PropertyNames.ExcludeLimitedNonUpgradable, excludeLimitedNonUpgradable); } if (excludeUnique is not null) { args.Add(PropertyNames.ExcludeUnique, excludeUnique); } if (excludeFromBlockchain is not null) { args.Add(PropertyNames.ExcludeFromBlockchain, excludeFromBlockchain); } if (sortByPrice is not null) { args.Add(PropertyNames.SortByPrice, sortByPrice); } if (offset is not null) { args.Add(PropertyNames.Offset, offset); } if (limit is not null) { args.Add(PropertyNames.Limit, limit); } return client.CallMethodAsync( MethodNames.GetBusinessAccountGifts, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getBusinessAccountStarBalance.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns on success. /// /// The instance. /// Unique identifier of the business connection /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static StarAmount GetBusinessAccountStarBalance( this ITelegramBotClient client, string businessConnectionId ) => client.GetBusinessAccountStarBalanceAsync(businessConnectionId).GetAwaiter().GetResult(); /// /// Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns on success. /// /// The instance. /// Unique identifier of the business connection /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetBusinessAccountStarBalanceAsync( this ITelegramBotClient client, string businessConnectionId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, }; return client.CallMethodAsync( MethodNames.GetBusinessAccountStarBalance, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getBusinessConnection.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get information about the connection of the bot with a business account. Returns a object on success. /// /// The instance. /// Unique identifier of the business connection /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static BusinessConnection GetBusinessConnection( this ITelegramBotClient client, string businessConnectionId ) => client.GetBusinessConnectionAsync(businessConnectionId).GetAwaiter().GetResult(); /// /// Use this method to get information about the connection of the bot with a business account. Returns a object on success. /// /// The instance. /// Unique identifier of the business connection /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetBusinessConnectionAsync( this ITelegramBotClient client, string businessConnectionId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, }; return client.CallMethodAsync( MethodNames.GetBusinessConnection, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getChat.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get up-to-date information about the chat. Returns a object on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatFullInfo GetChat(this ITelegramBotClient client, long chatId) => client.GetChatAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to get up-to-date information about the chat. Returns a object on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetChatAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync(MethodNames.GetChat, args, cancellationToken); } /// /// Use this method to get up-to-date information about the chat. Returns a object on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatFullInfo GetChat(this ITelegramBotClient client, string chatId) => client.GetChatAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to get up-to-date information about the chat. Returns a object on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetChatAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync(MethodNames.GetChat, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getChatAdministrators.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get a list of administrators in a chat. Returns an Array of objects. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// Pass True to additionally receive all bots that are administrators of the chat. By default, bots other than the current bot are omitted. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable GetChatAdministrators( this ITelegramBotClient client, long chatId, bool? returnBots = null ) => client.GetChatAdministratorsAsync(chatId, returnBots).GetAwaiter().GetResult(); /// /// Use this method to get a list of administrators in a chat. Returns an Array of objects. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// Pass True to additionally receive all bots that are administrators of the chat. By default, bots other than the current bot are omitted. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> GetChatAdministratorsAsync( this ITelegramBotClient client, long chatId, bool? returnBots = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; if (returnBots is not null) { args.Add(PropertyNames.ReturnBots, returnBots); } return client.CallMethodAsync>( MethodNames.GetChatAdministrators, args, cancellationToken ); } /// /// Use this method to get a list of administrators in a chat. Returns an Array of objects. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// Pass True to additionally receive all bots that are administrators of the chat. By default, bots other than the current bot are omitted. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable GetChatAdministrators( this ITelegramBotClient client, string chatId, bool? returnBots = null ) => client.GetChatAdministratorsAsync(chatId, returnBots).GetAwaiter().GetResult(); /// /// Use this method to get a list of administrators in a chat. Returns an Array of objects. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// Pass True to additionally receive all bots that are administrators of the chat. By default, bots other than the current bot are omitted. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> GetChatAdministratorsAsync( this ITelegramBotClient client, string chatId, bool? returnBots = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; if (returnBots is not null) { args.Add(PropertyNames.ReturnBots, returnBots); } return client.CallMethodAsync>( MethodNames.GetChatAdministrators, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getChatGifts.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Returns the gifts owned by a chat. Returns on success. /// /// The instance. /// The arguments for the "GetChatGifts" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static OwnedGifts GetChatGifts(this ITelegramBotClient client, GetChatGiftsArgs args) => client.GetChatGiftsAsync(args).GetAwaiter().GetResult(); /// /// Returns the gifts owned by a chat. Returns on success. /// /// The instance. /// The arguments for the "GetChatGifts" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetChatGiftsAsync( this ITelegramBotClient client, GetChatGiftsArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.GetChatGifts, args, cancellationToken ); } /// /// Returns the gifts owned by a chat. Returns on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel. /// Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel. /// Pass True to exclude gifts that can be purchased an unlimited number of times /// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique /// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique /// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram /// Pass True to exclude unique gifts /// Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. /// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results /// The maximum number of gifts to be returned; 1-100. Defaults to 100 /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static OwnedGifts GetChatGifts( this ITelegramBotClient client, long chatId, bool? excludeUnsaved = null, bool? excludeSaved = null, bool? excludeUnlimited = null, bool? excludeLimitedUpgradable = null, bool? excludeLimitedNonUpgradable = null, bool? excludeFromBlockchain = null, bool? excludeUnique = null, bool? sortByPrice = null, string? offset = null, int? limit = null ) => client .GetChatGiftsAsync( chatId, excludeUnsaved, excludeSaved, excludeUnlimited, excludeLimitedUpgradable, excludeLimitedNonUpgradable, excludeFromBlockchain, excludeUnique, sortByPrice, offset, limit ) .GetAwaiter() .GetResult(); /// /// Returns the gifts owned by a chat. Returns on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel. /// Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel. /// Pass True to exclude gifts that can be purchased an unlimited number of times /// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique /// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique /// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram /// Pass True to exclude unique gifts /// Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. /// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results /// The maximum number of gifts to be returned; 1-100. Defaults to 100 /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetChatGiftsAsync( this ITelegramBotClient client, long chatId, bool? excludeUnsaved = null, bool? excludeSaved = null, bool? excludeUnlimited = null, bool? excludeLimitedUpgradable = null, bool? excludeLimitedNonUpgradable = null, bool? excludeFromBlockchain = null, bool? excludeUnique = null, bool? sortByPrice = null, string? offset = null, int? limit = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; if (excludeUnsaved is not null) { args.Add(PropertyNames.ExcludeUnsaved, excludeUnsaved); } if (excludeSaved is not null) { args.Add(PropertyNames.ExcludeSaved, excludeSaved); } if (excludeUnlimited is not null) { args.Add(PropertyNames.ExcludeUnlimited, excludeUnlimited); } if (excludeLimitedUpgradable is not null) { args.Add(PropertyNames.ExcludeLimitedUpgradable, excludeLimitedUpgradable); } if (excludeLimitedNonUpgradable is not null) { args.Add(PropertyNames.ExcludeLimitedNonUpgradable, excludeLimitedNonUpgradable); } if (excludeFromBlockchain is not null) { args.Add(PropertyNames.ExcludeFromBlockchain, excludeFromBlockchain); } if (excludeUnique is not null) { args.Add(PropertyNames.ExcludeUnique, excludeUnique); } if (sortByPrice is not null) { args.Add(PropertyNames.SortByPrice, sortByPrice); } if (offset is not null) { args.Add(PropertyNames.Offset, offset); } if (limit is not null) { args.Add(PropertyNames.Limit, limit); } return client.CallMethodAsync( MethodNames.GetChatGifts, args, cancellationToken ); } /// /// Returns the gifts owned by a chat. Returns on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel. /// Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel. /// Pass True to exclude gifts that can be purchased an unlimited number of times /// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique /// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique /// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram /// Pass True to exclude unique gifts /// Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. /// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results /// The maximum number of gifts to be returned; 1-100. Defaults to 100 /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static OwnedGifts GetChatGifts( this ITelegramBotClient client, string chatId, bool? excludeUnsaved = null, bool? excludeSaved = null, bool? excludeUnlimited = null, bool? excludeLimitedUpgradable = null, bool? excludeLimitedNonUpgradable = null, bool? excludeFromBlockchain = null, bool? excludeUnique = null, bool? sortByPrice = null, string? offset = null, int? limit = null ) => client .GetChatGiftsAsync( chatId, excludeUnsaved, excludeSaved, excludeUnlimited, excludeLimitedUpgradable, excludeLimitedNonUpgradable, excludeFromBlockchain, excludeUnique, sortByPrice, offset, limit ) .GetAwaiter() .GetResult(); /// /// Returns the gifts owned by a chat. Returns on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel. /// Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel. /// Pass True to exclude gifts that can be purchased an unlimited number of times /// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique /// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique /// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram /// Pass True to exclude unique gifts /// Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. /// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results /// The maximum number of gifts to be returned; 1-100. Defaults to 100 /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetChatGiftsAsync( this ITelegramBotClient client, string chatId, bool? excludeUnsaved = null, bool? excludeSaved = null, bool? excludeUnlimited = null, bool? excludeLimitedUpgradable = null, bool? excludeLimitedNonUpgradable = null, bool? excludeFromBlockchain = null, bool? excludeUnique = null, bool? sortByPrice = null, string? offset = null, int? limit = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; if (excludeUnsaved is not null) { args.Add(PropertyNames.ExcludeUnsaved, excludeUnsaved); } if (excludeSaved is not null) { args.Add(PropertyNames.ExcludeSaved, excludeSaved); } if (excludeUnlimited is not null) { args.Add(PropertyNames.ExcludeUnlimited, excludeUnlimited); } if (excludeLimitedUpgradable is not null) { args.Add(PropertyNames.ExcludeLimitedUpgradable, excludeLimitedUpgradable); } if (excludeLimitedNonUpgradable is not null) { args.Add(PropertyNames.ExcludeLimitedNonUpgradable, excludeLimitedNonUpgradable); } if (excludeFromBlockchain is not null) { args.Add(PropertyNames.ExcludeFromBlockchain, excludeFromBlockchain); } if (excludeUnique is not null) { args.Add(PropertyNames.ExcludeUnique, excludeUnique); } if (sortByPrice is not null) { args.Add(PropertyNames.SortByPrice, sortByPrice); } if (offset is not null) { args.Add(PropertyNames.Offset, offset); } if (limit is not null) { args.Add(PropertyNames.Limit, limit); } return client.CallMethodAsync( MethodNames.GetChatGifts, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getChatMember.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a object on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// Unique identifier of the target user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatMember GetChatMember( this ITelegramBotClient client, long chatId, long userId ) => client.GetChatMemberAsync(chatId, userId).GetAwaiter().GetResult(); /// /// Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a object on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// Unique identifier of the target user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetChatMemberAsync( this ITelegramBotClient client, long chatId, long userId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.UserId, userId }, }; return client.CallMethodAsync( MethodNames.GetChatMember, args, cancellationToken ); } /// /// Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a object on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// Unique identifier of the target user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatMember GetChatMember( this ITelegramBotClient client, string chatId, long userId ) => client.GetChatMemberAsync(chatId, userId).GetAwaiter().GetResult(); /// /// Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a object on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// Unique identifier of the target user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetChatMemberAsync( this ITelegramBotClient client, string chatId, long userId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.UserId, userId }, }; return client.CallMethodAsync( MethodNames.GetChatMember, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getChatMemberCount.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get the number of members in a chat. Returns Int on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static int GetChatMemberCount(this ITelegramBotClient client, long chatId) => client.GetChatMemberCountAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to get the number of members in a chat. Returns Int on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetChatMemberCountAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync(MethodNames.GetChatMemberCount, args, cancellationToken); } /// /// Use this method to get the number of members in a chat. Returns Int on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static int GetChatMemberCount(this ITelegramBotClient client, string chatId) => client.GetChatMemberCountAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to get the number of members in a chat. Returns Int on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetChatMemberCountAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync(MethodNames.GetChatMemberCount, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getChatMenuButton.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns on success. /// /// The instance. /// Unique identifier for the target private chat. If not specified, default bot's menu button will be returned /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static MenuButton GetChatMenuButton( this ITelegramBotClient client, long? chatId = null ) => client.GetChatMenuButtonAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns on success. /// /// The instance. /// Unique identifier for the target private chat. If not specified, default bot's menu button will be returned /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetChatMenuButtonAsync( this ITelegramBotClient client, long? chatId = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { }; if (chatId is not null) { args.Add(PropertyNames.ChatId, chatId); } return client.CallMethodAsync( MethodNames.GetChatMenuButton, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getFile.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again. /// /// The instance. /// File identifier to get information about /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static File GetFile(this ITelegramBotClient client, string fileId) => client.GetFileAsync(fileId).GetAwaiter().GetResult(); /// /// Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again. /// /// The instance. /// File identifier to get information about /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetFileAsync( this ITelegramBotClient client, string fileId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.FileId, fileId ?? throw new ArgumentNullException(nameof(fileId)) }, }; return client.CallMethodAsync(MethodNames.GetFile, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getForumTopicIconStickers.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Stickers; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of objects. /// /// The instance. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable GetForumTopicIconStickers(this ITelegramBotClient client) => client.GetForumTopicIconStickersAsync().GetAwaiter().GetResult(); /// /// Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of objects. /// /// The instance. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> GetForumTopicIconStickersAsync( this ITelegramBotClient client, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync>( MethodNames.GetForumTopicIconStickers, cancellationToken: cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getManagedBotAccessSettings.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get the access settings of a managed bot. Returns a object on success. /// /// The instance. /// User identifier of the managed bot whose access settings will be returned /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static BotAccessSettings GetManagedBotAccessSettings( this ITelegramBotClient client, long userId ) => client.GetManagedBotAccessSettingsAsync(userId).GetAwaiter().GetResult(); /// /// Use this method to get the access settings of a managed bot. Returns a object on success. /// /// The instance. /// User identifier of the managed bot whose access settings will be returned /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetManagedBotAccessSettingsAsync( this ITelegramBotClient client, long userId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId } }; return client.CallMethodAsync( MethodNames.GetManagedBotAccessSettings, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getManagedBotToken.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get the token of a managed bot. Returns the token as String on success. /// /// The instance. /// User identifier of the managed bot whose token will be returned /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static string GetManagedBotToken(this ITelegramBotClient client, long userId) => client.GetManagedBotTokenAsync(userId).GetAwaiter().GetResult(); /// /// Use this method to get the token of a managed bot. Returns the token as String on success. /// /// The instance. /// User identifier of the managed bot whose token will be returned /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetManagedBotTokenAsync( this ITelegramBotClient client, long userId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId } }; return client.CallMethodAsync( MethodNames.GetManagedBotToken, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getMe.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a object. /// /// The instance. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static User GetMe(this ITelegramBotClient client) => client.GetMeAsync().GetAwaiter().GetResult(); /// /// A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a object. /// /// The instance. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetMeAsync( this ITelegramBotClient client, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.GetMe, cancellationToken: cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getMyCommands.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of objects. If commands aren't set, an empty list is returned. /// /// The instance. /// The arguments for the "GetMyCommands" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable GetMyCommands( this ITelegramBotClient client, GetMyCommandsArgs args ) => client.GetMyCommandsAsync(args).GetAwaiter().GetResult(); /// /// Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of objects. If commands aren't set, an empty list is returned. /// /// The instance. /// The arguments for the "GetMyCommands" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> GetMyCommandsAsync( this ITelegramBotClient client, GetMyCommandsArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync>( MethodNames.GetMyCommands, args, cancellationToken ); } /// /// Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of objects. If commands aren't set, an empty list is returned. /// /// The instance. /// A JSON-serialized object, describing scope of users. Defaults to . /// A two-letter ISO 639-1 language code or an empty string /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable GetMyCommands( this ITelegramBotClient client, BotCommandScope? scope = null, string? languageCode = null ) => client.GetMyCommandsAsync(scope, languageCode).GetAwaiter().GetResult(); /// /// Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of objects. If commands aren't set, an empty list is returned. /// /// The instance. /// A JSON-serialized object, describing scope of users. Defaults to . /// A two-letter ISO 639-1 language code or an empty string /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> GetMyCommandsAsync( this ITelegramBotClient client, BotCommandScope? scope = null, string? languageCode = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { }; if (scope is not null) { args.Add(PropertyNames.Scope, scope); } if (languageCode is not null) { args.Add(PropertyNames.LanguageCode, languageCode); } return client.CallMethodAsync>( MethodNames.GetMyCommands, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getMyDefaultAdministratorRights.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get the current default administrator rights of the bot. Returns on success. /// /// The instance. /// Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatAdministratorRights GetMyDefaultAdministratorRights( this ITelegramBotClient client, bool? forChannels = null ) => client.GetMyDefaultAdministratorRightsAsync(forChannels).GetAwaiter().GetResult(); /// /// Use this method to get the current default administrator rights of the bot. Returns on success. /// /// The instance. /// Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetMyDefaultAdministratorRightsAsync( this ITelegramBotClient client, bool? forChannels = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { }; if (forChannels is not null) { args.Add(PropertyNames.ForChannels, forChannels); } return client.CallMethodAsync( MethodNames.GetMyDefaultAdministratorRights, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getMyDescription.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get the current bot description for the given user language. Returns on success. /// /// The instance. /// A two-letter ISO 639-1 language code or an empty string /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static BotDescription GetMyDescription( this ITelegramBotClient client, string? languageCode = null ) => client.GetMyDescriptionAsync(languageCode).GetAwaiter().GetResult(); /// /// Use this method to get the current bot description for the given user language. Returns on success. /// /// The instance. /// A two-letter ISO 639-1 language code or an empty string /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetMyDescriptionAsync( this ITelegramBotClient client, string? languageCode = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { }; if (languageCode is not null) { args.Add(PropertyNames.LanguageCode, languageCode); } return client.CallMethodAsync( MethodNames.GetMyDescription, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getMyName.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get the current bot name for the given user language. Returns on success. /// /// The instance. /// A two-letter ISO 639-1 language code or an empty string /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static BotName GetMyName(this ITelegramBotClient client, string? languageCode = null) => client.GetMyNameAsync(languageCode).GetAwaiter().GetResult(); /// /// Use this method to get the current bot name for the given user language. Returns on success. /// /// The instance. /// A two-letter ISO 639-1 language code or an empty string /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetMyNameAsync( this ITelegramBotClient client, string? languageCode = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { }; if (languageCode is not null) { args.Add(PropertyNames.LanguageCode, languageCode); } return client.CallMethodAsync(MethodNames.GetMyName, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getMyShortDescription.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get the current bot short description for the given user language. Returns on success. /// /// The instance. /// A two-letter ISO 639-1 language code or an empty string /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static BotShortDescription GetMyShortDescription( this ITelegramBotClient client, string? languageCode = null ) => client.GetMyShortDescriptionAsync(languageCode).GetAwaiter().GetResult(); /// /// Use this method to get the current bot short description for the given user language. Returns on success. /// /// The instance. /// A two-letter ISO 639-1 language code or an empty string /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetMyShortDescriptionAsync( this ITelegramBotClient client, string? languageCode = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { }; if (languageCode is not null) { args.Add(PropertyNames.LanguageCode, languageCode); } return client.CallMethodAsync( MethodNames.GetMyShortDescription, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getUserChatBoosts.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a object. /// /// The instance. /// Unique identifier for the chat or username of the channel in the format @username /// Unique identifier of the target user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static UserChatBoosts GetUserChatBoosts( this ITelegramBotClient client, long chatId, long userId ) => client.GetUserChatBoostsAsync(chatId, userId).GetAwaiter().GetResult(); /// /// Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a object. /// /// The instance. /// Unique identifier for the chat or username of the channel in the format @username /// Unique identifier of the target user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetUserChatBoostsAsync( this ITelegramBotClient client, long chatId, long userId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.UserId, userId }, }; return client.CallMethodAsync( MethodNames.GetUserChatBoosts, args, cancellationToken ); } /// /// Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a object. /// /// The instance. /// Unique identifier for the chat or username of the channel in the format @username /// Unique identifier of the target user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static UserChatBoosts GetUserChatBoosts( this ITelegramBotClient client, string chatId, long userId ) => client.GetUserChatBoostsAsync(chatId, userId).GetAwaiter().GetResult(); /// /// Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a object. /// /// The instance. /// Unique identifier for the chat or username of the channel in the format @username /// Unique identifier of the target user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetUserChatBoostsAsync( this ITelegramBotClient client, string chatId, long userId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.UserId, userId }, }; return client.CallMethodAsync( MethodNames.GetUserChatBoosts, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getUserGifts.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Returns the gifts owned and hosted by a user. Returns on success. /// /// The instance. /// The arguments for the "GetUserGifts" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static OwnedGifts GetUserGifts(this ITelegramBotClient client, GetUserGiftsArgs args) => client.GetUserGiftsAsync(args).GetAwaiter().GetResult(); /// /// Returns the gifts owned and hosted by a user. Returns on success. /// /// The instance. /// The arguments for the "GetUserGifts" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetUserGiftsAsync( this ITelegramBotClient client, GetUserGiftsArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.GetUserGifts, args, cancellationToken ); } /// /// Returns the gifts owned and hosted by a user. Returns on success. /// /// The instance. /// Unique identifier of the user /// Pass True to exclude gifts that can be purchased an unlimited number of times /// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique /// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique /// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram /// Pass True to exclude unique gifts /// Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. /// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results /// The maximum number of gifts to be returned; 1-100. Defaults to 100 /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static OwnedGifts GetUserGifts( this ITelegramBotClient client, long userId, bool? excludeUnlimited = null, bool? excludeLimitedUpgradable = null, bool? excludeLimitedNonUpgradable = null, bool? excludeFromBlockchain = null, bool? excludeUnique = null, bool? sortByPrice = null, string? offset = null, int? limit = null ) => client .GetUserGiftsAsync( userId, excludeUnlimited, excludeLimitedUpgradable, excludeLimitedNonUpgradable, excludeFromBlockchain, excludeUnique, sortByPrice, offset, limit ) .GetAwaiter() .GetResult(); /// /// Returns the gifts owned and hosted by a user. Returns on success. /// /// The instance. /// Unique identifier of the user /// Pass True to exclude gifts that can be purchased an unlimited number of times /// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique /// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique /// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram /// Pass True to exclude unique gifts /// Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. /// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results /// The maximum number of gifts to be returned; 1-100. Defaults to 100 /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetUserGiftsAsync( this ITelegramBotClient client, long userId, bool? excludeUnlimited = null, bool? excludeLimitedUpgradable = null, bool? excludeLimitedNonUpgradable = null, bool? excludeFromBlockchain = null, bool? excludeUnique = null, bool? sortByPrice = null, string? offset = null, int? limit = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId } }; if (excludeUnlimited is not null) { args.Add(PropertyNames.ExcludeUnlimited, excludeUnlimited); } if (excludeLimitedUpgradable is not null) { args.Add(PropertyNames.ExcludeLimitedUpgradable, excludeLimitedUpgradable); } if (excludeLimitedNonUpgradable is not null) { args.Add(PropertyNames.ExcludeLimitedNonUpgradable, excludeLimitedNonUpgradable); } if (excludeFromBlockchain is not null) { args.Add(PropertyNames.ExcludeFromBlockchain, excludeFromBlockchain); } if (excludeUnique is not null) { args.Add(PropertyNames.ExcludeUnique, excludeUnique); } if (sortByPrice is not null) { args.Add(PropertyNames.SortByPrice, sortByPrice); } if (offset is not null) { args.Add(PropertyNames.Offset, offset); } if (limit is not null) { args.Add(PropertyNames.Limit, limit); } return client.CallMethodAsync( MethodNames.GetUserGifts, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getUserPersonalChatMessages.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get the last messages from the personal chat (i.e., the chat currently added to their profile) of a given user. On success, an array of objects is returned. /// /// The instance. /// Unique identifier for the target user /// The maximum number of messages to return; 1-20 /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable GetUserPersonalChatMessages( this ITelegramBotClient client, long userId, int limit ) => client.GetUserPersonalChatMessagesAsync(userId, limit).GetAwaiter().GetResult(); /// /// Use this method to get the last messages from the personal chat (i.e., the chat currently added to their profile) of a given user. On success, an array of objects is returned. /// /// The instance. /// Unique identifier for the target user /// The maximum number of messages to return; 1-20 /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> GetUserPersonalChatMessagesAsync( this ITelegramBotClient client, long userId, int limit, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId }, { PropertyNames.Limit, limit }, }; return client.CallMethodAsync>( MethodNames.GetUserPersonalChatMessages, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getUserProfileAudios.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get a list of profile audios for a user. Returns a object. /// /// The instance. /// Unique identifier of the target user /// Sequential number of the first audio to be returned. By default, all audios are returned. /// Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static UserProfileAudios GetUserProfileAudios( this ITelegramBotClient client, long userId, int? offset = null, int? limit = null ) => client.GetUserProfileAudiosAsync(userId, offset, limit).GetAwaiter().GetResult(); /// /// Use this method to get a list of profile audios for a user. Returns a object. /// /// The instance. /// Unique identifier of the target user /// Sequential number of the first audio to be returned. By default, all audios are returned. /// Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetUserProfileAudiosAsync( this ITelegramBotClient client, long userId, int? offset = null, int? limit = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId } }; if (offset is not null) { args.Add(PropertyNames.Offset, offset); } if (limit is not null) { args.Add(PropertyNames.Limit, limit); } return client.CallMethodAsync( MethodNames.GetUserProfileAudios, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/getUserProfilePhotos.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to get a list of profile pictures for a user. Returns a object. /// /// The instance. /// Unique identifier of the target user /// Sequential number of the first photo to be returned. By default, all photos are returned. /// Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static UserProfilePhotos GetUserProfilePhotos( this ITelegramBotClient client, long userId, int? offset = null, int? limit = null ) => client.GetUserProfilePhotosAsync(userId, offset, limit).GetAwaiter().GetResult(); /// /// Use this method to get a list of profile pictures for a user. Returns a object. /// /// The instance. /// Unique identifier of the target user /// Sequential number of the first photo to be returned. By default, all photos are returned. /// Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GetUserProfilePhotosAsync( this ITelegramBotClient client, long userId, int? offset = null, int? limit = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId } }; if (offset is not null) { args.Add(PropertyNames.Offset, offset); } if (limit is not null) { args.Add(PropertyNames.Limit, limit); } return client.CallMethodAsync( MethodNames.GetUserProfilePhotos, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/giftPremiumSubscription.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Gifts a Telegram Premium subscription to the given user. Returns True on success. /// /// The instance. /// The arguments for the "GiftPremiumSubscription" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool GiftPremiumSubscription( this ITelegramBotClient client, GiftPremiumSubscriptionArgs args ) => client.GiftPremiumSubscriptionAsync(args).GetAwaiter().GetResult(); /// /// Gifts a Telegram Premium subscription to the given user. Returns True on success. /// /// The instance. /// The arguments for the "GiftPremiumSubscription" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GiftPremiumSubscriptionAsync( this ITelegramBotClient client, GiftPremiumSubscriptionArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.GiftPremiumSubscription, args, cancellationToken ); } /// /// Gifts a Telegram Premium subscription to the given user. Returns True on success. /// /// The instance. /// Unique identifier of the target user who will receive a Telegram Premium subscription /// Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12 /// Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months /// Text that will be shown along with the service message about the subscription; 0-128 characters /// Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored. /// A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool GiftPremiumSubscription( this ITelegramBotClient client, long userId, int monthCount, int starCount, string? text = null, string? textParseMode = null, IEnumerable? textEntities = null ) => client .GiftPremiumSubscriptionAsync( userId, monthCount, starCount, text, textParseMode, textEntities ) .GetAwaiter() .GetResult(); /// /// Gifts a Telegram Premium subscription to the given user. Returns True on success. /// /// The instance. /// Unique identifier of the target user who will receive a Telegram Premium subscription /// Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12 /// Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months /// Text that will be shown along with the service message about the subscription; 0-128 characters /// Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored. /// A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task GiftPremiumSubscriptionAsync( this ITelegramBotClient client, long userId, int monthCount, int starCount, string? text = null, string? textParseMode = null, IEnumerable? textEntities = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId }, { PropertyNames.MonthCount, monthCount }, { PropertyNames.StarCount, starCount }, }; if (text is not null) { args.Add(PropertyNames.Text, text); } if (textParseMode is not null) { args.Add(PropertyNames.TextParseMode, textParseMode); } if (textEntities is not null) { args.Add(PropertyNames.TextEntities, textEntities); } return client.CallMethodAsync( MethodNames.GiftPremiumSubscription, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/hideGeneralForumTopic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool HideGeneralForumTopic(this ITelegramBotClient client, long chatId) => client.HideGeneralForumTopicAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task HideGeneralForumTopicAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync( MethodNames.HideGeneralForumTopic, args, cancellationToken ); } /// /// Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool HideGeneralForumTopic(this ITelegramBotClient client, string chatId) => client.HideGeneralForumTopicAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task HideGeneralForumTopicAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync( MethodNames.HideGeneralForumTopic, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/leaveChat.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method for your bot to leave a group, supergroup or channel. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username. Channel direct messages chats aren't supported; leave the corresponding channel instead. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool LeaveChat(this ITelegramBotClient client, long chatId) => client.LeaveChatAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method for your bot to leave a group, supergroup or channel. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username. Channel direct messages chats aren't supported; leave the corresponding channel instead. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task LeaveChatAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync(MethodNames.LeaveChat, args, cancellationToken); } /// /// Use this method for your bot to leave a group, supergroup or channel. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username. Channel direct messages chats aren't supported; leave the corresponding channel instead. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool LeaveChat(this ITelegramBotClient client, string chatId) => client.LeaveChatAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method for your bot to leave a group, supergroup or channel. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup or channel in the format @username. Channel direct messages chats aren't supported; leave the corresponding channel instead. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task LeaveChatAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync(MethodNames.LeaveChat, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/logOut.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. /// /// The instance. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool LogOut(this ITelegramBotClient client) => client.LogOutAsync().GetAwaiter().GetResult(); /// /// Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. /// /// The instance. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task LogOutAsync( this ITelegramBotClient client, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.LogOut, cancellationToken: cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/pinChatMessage.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to pin messages in groups and channels respectively. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Identifier of a message to pin /// Unique identifier of the business connection on behalf of which the message will be pinned /// Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool PinChatMessage( this ITelegramBotClient client, long chatId, int messageId, string? businessConnectionId = null, bool? disableNotification = null ) => client .PinChatMessageAsync(chatId, messageId, businessConnectionId, disableNotification) .GetAwaiter() .GetResult(); /// /// Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to pin messages in groups and channels respectively. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Identifier of a message to pin /// Unique identifier of the business connection on behalf of which the message will be pinned /// Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task PinChatMessageAsync( this ITelegramBotClient client, long chatId, int messageId, string? businessConnectionId = null, bool? disableNotification = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.MessageId, messageId }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } return client.CallMethodAsync(MethodNames.PinChatMessage, args, cancellationToken); } /// /// Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to pin messages in groups and channels respectively. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Identifier of a message to pin /// Unique identifier of the business connection on behalf of which the message will be pinned /// Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool PinChatMessage( this ITelegramBotClient client, string chatId, int messageId, string? businessConnectionId = null, bool? disableNotification = null ) => client .PinChatMessageAsync(chatId, messageId, businessConnectionId, disableNotification) .GetAwaiter() .GetResult(); /// /// Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to pin messages in groups and channels respectively. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Identifier of a message to pin /// Unique identifier of the business connection on behalf of which the message will be pinned /// Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task PinChatMessageAsync( this ITelegramBotClient client, string chatId, int messageId, string? businessConnectionId = null, bool? disableNotification = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.MessageId, messageId }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } return client.CallMethodAsync(MethodNames.PinChatMessage, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/postStory.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns on success. /// /// The instance. /// The arguments for the "PostStory" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Story PostStory(this ITelegramBotClient client, PostStoryArgs args) => client.PostStoryAsync(args).GetAwaiter().GetResult(); /// /// Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns on success. /// /// The instance. /// The arguments for the "PostStory" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task PostStoryAsync( this ITelegramBotClient client, PostStoryArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.PostStory, args, cancellationToken); } /// /// Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns on success. /// /// The instance. /// Unique identifier of the business connection /// Content of the story /// Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 /// Caption of the story, 0-2048 characters after entities parsing /// Mode for parsing entities in the story caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// A JSON-serialized list of clickable areas to be shown on the story /// Pass True to keep the story accessible after it expires /// Pass True if the content of the story must be protected from forwarding and screenshotting /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Story PostStory( this ITelegramBotClient client, string businessConnectionId, InputStoryContent content, int activePeriod, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, IEnumerable? areas = null, bool? postToChatPage = null, bool? protectContent = null ) => client .PostStoryAsync( businessConnectionId, content, activePeriod, caption, parseMode, captionEntities, areas, postToChatPage, protectContent ) .GetAwaiter() .GetResult(); /// /// Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns on success. /// /// The instance. /// Unique identifier of the business connection /// Content of the story /// Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 /// Caption of the story, 0-2048 characters after entities parsing /// Mode for parsing entities in the story caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// A JSON-serialized list of clickable areas to be shown on the story /// Pass True to keep the story accessible after it expires /// Pass True if the content of the story must be protected from forwarding and screenshotting /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task PostStoryAsync( this ITelegramBotClient client, string businessConnectionId, InputStoryContent content, int activePeriod, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, IEnumerable? areas = null, bool? postToChatPage = null, bool? protectContent = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.Content, content ?? throw new ArgumentNullException(nameof(content)) }, { PropertyNames.ActivePeriod, activePeriod }, }; if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (areas is not null) { args.Add(PropertyNames.Areas, areas); } if (postToChatPage is not null) { args.Add(PropertyNames.PostToChatPage, postToChatPage); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } return client.CallMethodAsync(MethodNames.PostStory, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/promoteChatMember.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success. /// /// The instance. /// The arguments for the "PromoteChatMember" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool PromoteChatMember( this ITelegramBotClient client, PromoteChatMemberArgs args ) => client.PromoteChatMemberAsync(args).GetAwaiter().GetResult(); /// /// Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success. /// /// The instance. /// The arguments for the "PromoteChatMember" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task PromoteChatMemberAsync( this ITelegramBotClient client, PromoteChatMemberArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.PromoteChatMember, args, cancellationToken); } /// /// Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user /// Pass True if the administrator's presence in the chat is hidden /// Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. /// Pass True if the administrator can delete messages of other users /// Pass True if the administrator can manage video chats /// Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators /// Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him) /// Pass True if the administrator can change chat title, photo and other settings /// Pass True if the administrator can invite new users to the chat /// Pass True if the administrator can post stories to the chat /// Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive /// Pass True if the administrator can delete stories posted by other users /// Pass True if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only /// Pass True if the administrator can edit messages of other users and can pin messages; for channels only /// Pass True if the administrator can pin messages; for supergroups only /// Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only /// Pass True if the administrator can manage direct messages within the channel and decline suggested posts; for channels only /// Pass True if the administrator can edit the tags of regular members; for groups and supergroups only /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool PromoteChatMember( this ITelegramBotClient client, long chatId, long userId, bool? isAnonymous = null, bool? canManageChat = null, bool? canDeleteMessages = null, bool? canManageVideoChats = null, bool? canRestrictMembers = null, bool? canPromoteMembers = null, bool? canChangeInfo = null, bool? canInviteUsers = null, bool? canPostStories = null, bool? canEditStories = null, bool? canDeleteStories = null, bool? canPostMessages = null, bool? canEditMessages = null, bool? canPinMessages = null, bool? canManageTopics = null, bool? canManageDirectMessages = null, bool? canManageTags = null ) => client .PromoteChatMemberAsync( chatId, userId, isAnonymous, canManageChat, canDeleteMessages, canManageVideoChats, canRestrictMembers, canPromoteMembers, canChangeInfo, canInviteUsers, canPostStories, canEditStories, canDeleteStories, canPostMessages, canEditMessages, canPinMessages, canManageTopics, canManageDirectMessages, canManageTags ) .GetAwaiter() .GetResult(); /// /// Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user /// Pass True if the administrator's presence in the chat is hidden /// Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. /// Pass True if the administrator can delete messages of other users /// Pass True if the administrator can manage video chats /// Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators /// Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him) /// Pass True if the administrator can change chat title, photo and other settings /// Pass True if the administrator can invite new users to the chat /// Pass True if the administrator can post stories to the chat /// Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive /// Pass True if the administrator can delete stories posted by other users /// Pass True if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only /// Pass True if the administrator can edit messages of other users and can pin messages; for channels only /// Pass True if the administrator can pin messages; for supergroups only /// Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only /// Pass True if the administrator can manage direct messages within the channel and decline suggested posts; for channels only /// Pass True if the administrator can edit the tags of regular members; for groups and supergroups only /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task PromoteChatMemberAsync( this ITelegramBotClient client, long chatId, long userId, bool? isAnonymous = null, bool? canManageChat = null, bool? canDeleteMessages = null, bool? canManageVideoChats = null, bool? canRestrictMembers = null, bool? canPromoteMembers = null, bool? canChangeInfo = null, bool? canInviteUsers = null, bool? canPostStories = null, bool? canEditStories = null, bool? canDeleteStories = null, bool? canPostMessages = null, bool? canEditMessages = null, bool? canPinMessages = null, bool? canManageTopics = null, bool? canManageDirectMessages = null, bool? canManageTags = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.UserId, userId }, }; if (isAnonymous is not null) { args.Add(PropertyNames.IsAnonymous, isAnonymous); } if (canManageChat is not null) { args.Add(PropertyNames.CanManageChat, canManageChat); } if (canDeleteMessages is not null) { args.Add(PropertyNames.CanDeleteMessages, canDeleteMessages); } if (canManageVideoChats is not null) { args.Add(PropertyNames.CanManageVideoChats, canManageVideoChats); } if (canRestrictMembers is not null) { args.Add(PropertyNames.CanRestrictMembers, canRestrictMembers); } if (canPromoteMembers is not null) { args.Add(PropertyNames.CanPromoteMembers, canPromoteMembers); } if (canChangeInfo is not null) { args.Add(PropertyNames.CanChangeInfo, canChangeInfo); } if (canInviteUsers is not null) { args.Add(PropertyNames.CanInviteUsers, canInviteUsers); } if (canPostStories is not null) { args.Add(PropertyNames.CanPostStories, canPostStories); } if (canEditStories is not null) { args.Add(PropertyNames.CanEditStories, canEditStories); } if (canDeleteStories is not null) { args.Add(PropertyNames.CanDeleteStories, canDeleteStories); } if (canPostMessages is not null) { args.Add(PropertyNames.CanPostMessages, canPostMessages); } if (canEditMessages is not null) { args.Add(PropertyNames.CanEditMessages, canEditMessages); } if (canPinMessages is not null) { args.Add(PropertyNames.CanPinMessages, canPinMessages); } if (canManageTopics is not null) { args.Add(PropertyNames.CanManageTopics, canManageTopics); } if (canManageDirectMessages is not null) { args.Add(PropertyNames.CanManageDirectMessages, canManageDirectMessages); } if (canManageTags is not null) { args.Add(PropertyNames.CanManageTags, canManageTags); } return client.CallMethodAsync(MethodNames.PromoteChatMember, args, cancellationToken); } /// /// Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user /// Pass True if the administrator's presence in the chat is hidden /// Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. /// Pass True if the administrator can delete messages of other users /// Pass True if the administrator can manage video chats /// Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators /// Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him) /// Pass True if the administrator can change chat title, photo and other settings /// Pass True if the administrator can invite new users to the chat /// Pass True if the administrator can post stories to the chat /// Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive /// Pass True if the administrator can delete stories posted by other users /// Pass True if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only /// Pass True if the administrator can edit messages of other users and can pin messages; for channels only /// Pass True if the administrator can pin messages; for supergroups only /// Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only /// Pass True if the administrator can manage direct messages within the channel and decline suggested posts; for channels only /// Pass True if the administrator can edit the tags of regular members; for groups and supergroups only /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool PromoteChatMember( this ITelegramBotClient client, string chatId, long userId, bool? isAnonymous = null, bool? canManageChat = null, bool? canDeleteMessages = null, bool? canManageVideoChats = null, bool? canRestrictMembers = null, bool? canPromoteMembers = null, bool? canChangeInfo = null, bool? canInviteUsers = null, bool? canPostStories = null, bool? canEditStories = null, bool? canDeleteStories = null, bool? canPostMessages = null, bool? canEditMessages = null, bool? canPinMessages = null, bool? canManageTopics = null, bool? canManageDirectMessages = null, bool? canManageTags = null ) => client .PromoteChatMemberAsync( chatId, userId, isAnonymous, canManageChat, canDeleteMessages, canManageVideoChats, canRestrictMembers, canPromoteMembers, canChangeInfo, canInviteUsers, canPostStories, canEditStories, canDeleteStories, canPostMessages, canEditMessages, canPinMessages, canManageTopics, canManageDirectMessages, canManageTags ) .GetAwaiter() .GetResult(); /// /// Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target user /// Pass True if the administrator's presence in the chat is hidden /// Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. /// Pass True if the administrator can delete messages of other users /// Pass True if the administrator can manage video chats /// Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators /// Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him) /// Pass True if the administrator can change chat title, photo and other settings /// Pass True if the administrator can invite new users to the chat /// Pass True if the administrator can post stories to the chat /// Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive /// Pass True if the administrator can delete stories posted by other users /// Pass True if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only /// Pass True if the administrator can edit messages of other users and can pin messages; for channels only /// Pass True if the administrator can pin messages; for supergroups only /// Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only /// Pass True if the administrator can manage direct messages within the channel and decline suggested posts; for channels only /// Pass True if the administrator can edit the tags of regular members; for groups and supergroups only /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task PromoteChatMemberAsync( this ITelegramBotClient client, string chatId, long userId, bool? isAnonymous = null, bool? canManageChat = null, bool? canDeleteMessages = null, bool? canManageVideoChats = null, bool? canRestrictMembers = null, bool? canPromoteMembers = null, bool? canChangeInfo = null, bool? canInviteUsers = null, bool? canPostStories = null, bool? canEditStories = null, bool? canDeleteStories = null, bool? canPostMessages = null, bool? canEditMessages = null, bool? canPinMessages = null, bool? canManageTopics = null, bool? canManageDirectMessages = null, bool? canManageTags = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.UserId, userId }, }; if (isAnonymous is not null) { args.Add(PropertyNames.IsAnonymous, isAnonymous); } if (canManageChat is not null) { args.Add(PropertyNames.CanManageChat, canManageChat); } if (canDeleteMessages is not null) { args.Add(PropertyNames.CanDeleteMessages, canDeleteMessages); } if (canManageVideoChats is not null) { args.Add(PropertyNames.CanManageVideoChats, canManageVideoChats); } if (canRestrictMembers is not null) { args.Add(PropertyNames.CanRestrictMembers, canRestrictMembers); } if (canPromoteMembers is not null) { args.Add(PropertyNames.CanPromoteMembers, canPromoteMembers); } if (canChangeInfo is not null) { args.Add(PropertyNames.CanChangeInfo, canChangeInfo); } if (canInviteUsers is not null) { args.Add(PropertyNames.CanInviteUsers, canInviteUsers); } if (canPostStories is not null) { args.Add(PropertyNames.CanPostStories, canPostStories); } if (canEditStories is not null) { args.Add(PropertyNames.CanEditStories, canEditStories); } if (canDeleteStories is not null) { args.Add(PropertyNames.CanDeleteStories, canDeleteStories); } if (canPostMessages is not null) { args.Add(PropertyNames.CanPostMessages, canPostMessages); } if (canEditMessages is not null) { args.Add(PropertyNames.CanEditMessages, canEditMessages); } if (canPinMessages is not null) { args.Add(PropertyNames.CanPinMessages, canPinMessages); } if (canManageTopics is not null) { args.Add(PropertyNames.CanManageTopics, canManageTopics); } if (canManageDirectMessages is not null) { args.Add(PropertyNames.CanManageDirectMessages, canManageDirectMessages); } if (canManageTags is not null) { args.Add(PropertyNames.CanManageTags, canManageTags); } return client.CallMethodAsync(MethodNames.PromoteChatMember, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/readBusinessMessage.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection on behalf of which to read the message /// Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours. /// Unique identifier of the message to mark as read /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool ReadBusinessMessage( this ITelegramBotClient client, string businessConnectionId, long chatId, int messageId ) => client .ReadBusinessMessageAsync(businessConnectionId, chatId, messageId) .GetAwaiter() .GetResult(); /// /// Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection on behalf of which to read the message /// Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours. /// Unique identifier of the message to mark as read /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ReadBusinessMessageAsync( this ITelegramBotClient client, string businessConnectionId, long chatId, int messageId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.ChatId, chatId }, { PropertyNames.MessageId, messageId }, }; return client.CallMethodAsync( MethodNames.ReadBusinessMessage, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/removeBusinessAccountProfilePhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool RemoveBusinessAccountProfilePhoto( this ITelegramBotClient client, string businessConnectionId, bool? isPublic = null ) => client .RemoveBusinessAccountProfilePhotoAsync(businessConnectionId, isPublic) .GetAwaiter() .GetResult(); /// /// Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task RemoveBusinessAccountProfilePhotoAsync( this ITelegramBotClient client, string businessConnectionId, bool? isPublic = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, }; if (isPublic is not null) { args.Add(PropertyNames.IsPublic, isPublic); } return client.CallMethodAsync( MethodNames.RemoveBusinessAccountProfilePhoto, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/removeChatVerification.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot or channel in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool RemoveChatVerification(this ITelegramBotClient client, long chatId) => client.RemoveChatVerificationAsync(chatId).GetAwaiter().GetResult(); /// /// Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot or channel in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task RemoveChatVerificationAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync( MethodNames.RemoveChatVerification, args, cancellationToken ); } /// /// Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot or channel in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool RemoveChatVerification(this ITelegramBotClient client, string chatId) => client.RemoveChatVerificationAsync(chatId).GetAwaiter().GetResult(); /// /// Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot or channel in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task RemoveChatVerificationAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync( MethodNames.RemoveChatVerification, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/removeMyProfilePhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Removes the profile photo of the bot. Requires no parameters. Returns True on success. /// /// The instance. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool RemoveMyProfilePhoto(this ITelegramBotClient client) => client.RemoveMyProfilePhotoAsync().GetAwaiter().GetResult(); /// /// Removes the profile photo of the bot. Requires no parameters. Returns True on success. /// /// The instance. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task RemoveMyProfilePhotoAsync( this ITelegramBotClient client, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.RemoveMyProfilePhoto, cancellationToken: cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/removeUserVerification.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success. /// /// The instance. /// Unique identifier of the target user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool RemoveUserVerification(this ITelegramBotClient client, long userId) => client.RemoveUserVerificationAsync(userId).GetAwaiter().GetResult(); /// /// Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success. /// /// The instance. /// Unique identifier of the target user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task RemoveUserVerificationAsync( this ITelegramBotClient client, long userId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId } }; return client.CallMethodAsync( MethodNames.RemoveUserVerification, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/reopenForumTopic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool ReopenForumTopic( this ITelegramBotClient client, long chatId, int messageThreadId ) => client.ReopenForumTopicAsync(chatId, messageThreadId).GetAwaiter().GetResult(); /// /// Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ReopenForumTopicAsync( this ITelegramBotClient client, long chatId, int messageThreadId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.MessageThreadId, messageThreadId }, }; return client.CallMethodAsync(MethodNames.ReopenForumTopic, args, cancellationToken); } /// /// Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool ReopenForumTopic( this ITelegramBotClient client, string chatId, int messageThreadId ) => client.ReopenForumTopicAsync(chatId, messageThreadId).GetAwaiter().GetResult(); /// /// Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ReopenForumTopicAsync( this ITelegramBotClient client, string chatId, int messageThreadId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.MessageThreadId, messageThreadId }, }; return client.CallMethodAsync(MethodNames.ReopenForumTopic, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/reopenGeneralForumTopic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool ReopenGeneralForumTopic(this ITelegramBotClient client, long chatId) => client.ReopenGeneralForumTopicAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ReopenGeneralForumTopicAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync( MethodNames.ReopenGeneralForumTopic, args, cancellationToken ); } /// /// Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool ReopenGeneralForumTopic(this ITelegramBotClient client, string chatId) => client.ReopenGeneralForumTopicAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ReopenGeneralForumTopicAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync( MethodNames.ReopenGeneralForumTopic, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/replaceManagedBotToken.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as String on success. /// /// The instance. /// User identifier of the managed bot whose token will be replaced /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static string ReplaceManagedBotToken(this ITelegramBotClient client, long userId) => client.ReplaceManagedBotTokenAsync(userId).GetAwaiter().GetResult(); /// /// Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as String on success. /// /// The instance. /// User identifier of the managed bot whose token will be replaced /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task ReplaceManagedBotTokenAsync( this ITelegramBotClient client, long userId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId } }; return client.CallMethodAsync( MethodNames.ReplaceManagedBotToken, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/repostStory.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns on success. /// /// The instance. /// The arguments for the "RepostStory" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Story RepostStory(this ITelegramBotClient client, RepostStoryArgs args) => client.RepostStoryAsync(args).GetAwaiter().GetResult(); /// /// Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns on success. /// /// The instance. /// The arguments for the "RepostStory" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task RepostStoryAsync( this ITelegramBotClient client, RepostStoryArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.RepostStory, args, cancellationToken); } /// /// Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns on success. /// /// The instance. /// Unique identifier of the business connection /// Unique identifier of the chat which posted the story that should be reposted /// Unique identifier of the story that should be reposted /// Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 /// Pass True to keep the story accessible after it expires /// Pass True if the content of the story must be protected from forwarding and screenshotting /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Story RepostStory( this ITelegramBotClient client, string businessConnectionId, long fromChatId, int fromStoryId, int activePeriod, bool? postToChatPage = null, bool? protectContent = null ) => client .RepostStoryAsync( businessConnectionId, fromChatId, fromStoryId, activePeriod, postToChatPage, protectContent ) .GetAwaiter() .GetResult(); /// /// Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns on success. /// /// The instance. /// Unique identifier of the business connection /// Unique identifier of the chat which posted the story that should be reposted /// Unique identifier of the story that should be reposted /// Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 /// Pass True to keep the story accessible after it expires /// Pass True if the content of the story must be protected from forwarding and screenshotting /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task RepostStoryAsync( this ITelegramBotClient client, string businessConnectionId, long fromChatId, int fromStoryId, int activePeriod, bool? postToChatPage = null, bool? protectContent = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.FromChatId, fromChatId }, { PropertyNames.FromStoryId, fromStoryId }, { PropertyNames.ActivePeriod, activePeriod }, }; if (postToChatPage is not null) { args.Add(PropertyNames.PostToChatPage, postToChatPage); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } return client.CallMethodAsync(MethodNames.RepostStory, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/restrictChatMember.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success. /// /// The instance. /// The arguments for the "RestrictChatMember" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool RestrictChatMember( this ITelegramBotClient client, RestrictChatMemberArgs args ) => client.RestrictChatMemberAsync(args).GetAwaiter().GetResult(); /// /// Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success. /// /// The instance. /// The arguments for the "RestrictChatMember" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task RestrictChatMemberAsync( this ITelegramBotClient client, RestrictChatMemberArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.RestrictChatMember, args, cancellationToken ); } /// /// Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// A JSON-serialized object for new user permissions /// Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. /// Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool RestrictChatMember( this ITelegramBotClient client, long chatId, long userId, ChatPermissions permissions, bool? useIndependentChatPermissions = null, int? untilDate = null ) => client .RestrictChatMemberAsync( chatId, userId, permissions, useIndependentChatPermissions, untilDate ) .GetAwaiter() .GetResult(); /// /// Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// A JSON-serialized object for new user permissions /// Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. /// Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task RestrictChatMemberAsync( this ITelegramBotClient client, long chatId, long userId, ChatPermissions permissions, bool? useIndependentChatPermissions = null, int? untilDate = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.UserId, userId }, { PropertyNames.Permissions, permissions ?? throw new ArgumentNullException(nameof(permissions)) }, }; if (useIndependentChatPermissions is not null) { args.Add(PropertyNames.UseIndependentChatPermissions, useIndependentChatPermissions); } if (untilDate is not null) { args.Add(PropertyNames.UntilDate, untilDate); } return client.CallMethodAsync( MethodNames.RestrictChatMember, args, cancellationToken ); } /// /// Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// A JSON-serialized object for new user permissions /// Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. /// Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool RestrictChatMember( this ITelegramBotClient client, string chatId, long userId, ChatPermissions permissions, bool? useIndependentChatPermissions = null, int? untilDate = null ) => client .RestrictChatMemberAsync( chatId, userId, permissions, useIndependentChatPermissions, untilDate ) .GetAwaiter() .GetResult(); /// /// Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// A JSON-serialized object for new user permissions /// Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. /// Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task RestrictChatMemberAsync( this ITelegramBotClient client, string chatId, long userId, ChatPermissions permissions, bool? useIndependentChatPermissions = null, int? untilDate = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.UserId, userId }, { PropertyNames.Permissions, permissions ?? throw new ArgumentNullException(nameof(permissions)) }, }; if (useIndependentChatPermissions is not null) { args.Add(PropertyNames.UseIndependentChatPermissions, useIndependentChatPermissions); } if (untilDate is not null) { args.Add(PropertyNames.UntilDate, untilDate); } return client.CallMethodAsync( MethodNames.RestrictChatMember, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/revokeChatInviteLink.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as object. /// /// The instance. /// Unique identifier of the target chat or username of the target channel in the format @username /// The invite link to revoke /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatInviteLink RevokeChatInviteLink( this ITelegramBotClient client, long chatId, string inviteLink ) => client.RevokeChatInviteLinkAsync(chatId, inviteLink).GetAwaiter().GetResult(); /// /// Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as object. /// /// The instance. /// Unique identifier of the target chat or username of the target channel in the format @username /// The invite link to revoke /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task RevokeChatInviteLinkAsync( this ITelegramBotClient client, long chatId, string inviteLink, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.InviteLink, inviteLink ?? throw new ArgumentNullException(nameof(inviteLink)) }, }; return client.CallMethodAsync( MethodNames.RevokeChatInviteLink, args, cancellationToken ); } /// /// Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as object. /// /// The instance. /// Unique identifier of the target chat or username of the target channel in the format @username /// The invite link to revoke /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static ChatInviteLink RevokeChatInviteLink( this ITelegramBotClient client, string chatId, string inviteLink ) => client.RevokeChatInviteLinkAsync(chatId, inviteLink).GetAwaiter().GetResult(); /// /// Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as object. /// /// The instance. /// Unique identifier of the target chat or username of the target channel in the format @username /// The invite link to revoke /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task RevokeChatInviteLinkAsync( this ITelegramBotClient client, string chatId, string inviteLink, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.InviteLink, inviteLink ?? throw new ArgumentNullException(nameof(inviteLink)) }, }; return client.CallMethodAsync( MethodNames.RevokeChatInviteLink, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/savePreparedInlineMessage.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; using Telegram.BotAPI.InlineMode; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Stores a message that can be sent by a user of a Mini App. Returns a object. /// /// The instance. /// The arguments for the "SavePreparedInlineMessage" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static PreparedInlineMessage SavePreparedInlineMessage( this ITelegramBotClient client, SavePreparedInlineMessageArgs args ) => client.SavePreparedInlineMessageAsync(args).GetAwaiter().GetResult(); /// /// Stores a message that can be sent by a user of a Mini App. Returns a object. /// /// The instance. /// The arguments for the "SavePreparedInlineMessage" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SavePreparedInlineMessageAsync( this ITelegramBotClient client, SavePreparedInlineMessageArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.SavePreparedInlineMessage, args, cancellationToken ); } /// /// Stores a message that can be sent by a user of a Mini App. Returns a object. /// /// The instance. /// Unique identifier of the target user that can use the prepared message /// A JSON-serialized object describing the message to be sent /// Pass True if the message can be sent to private chats with users /// Pass True if the message can be sent to private chats with bots /// Pass True if the message can be sent to group and supergroup chats /// Pass True if the message can be sent to channel chats /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static PreparedInlineMessage SavePreparedInlineMessage( this ITelegramBotClient client, long userId, InlineQueryResult result, bool? allowUserChats = null, bool? allowBotChats = null, bool? allowGroupChats = null, bool? allowChannelChats = null ) => client .SavePreparedInlineMessageAsync( userId, result, allowUserChats, allowBotChats, allowGroupChats, allowChannelChats ) .GetAwaiter() .GetResult(); /// /// Stores a message that can be sent by a user of a Mini App. Returns a object. /// /// The instance. /// Unique identifier of the target user that can use the prepared message /// A JSON-serialized object describing the message to be sent /// Pass True if the message can be sent to private chats with users /// Pass True if the message can be sent to private chats with bots /// Pass True if the message can be sent to group and supergroup chats /// Pass True if the message can be sent to channel chats /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SavePreparedInlineMessageAsync( this ITelegramBotClient client, long userId, InlineQueryResult result, bool? allowUserChats = null, bool? allowBotChats = null, bool? allowGroupChats = null, bool? allowChannelChats = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId }, { PropertyNames.Result, result ?? throw new ArgumentNullException(nameof(result)) }, }; if (allowUserChats is not null) { args.Add(PropertyNames.AllowUserChats, allowUserChats); } if (allowBotChats is not null) { args.Add(PropertyNames.AllowBotChats, allowBotChats); } if (allowGroupChats is not null) { args.Add(PropertyNames.AllowGroupChats, allowGroupChats); } if (allowChannelChats is not null) { args.Add(PropertyNames.AllowChannelChats, allowChannelChats); } return client.CallMethodAsync( MethodNames.SavePreparedInlineMessage, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/savePreparedKeyboardButton.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Stores a keyboard button that can be used by a user within a Mini App. Returns a object. /// /// The instance. /// The arguments for the "SavePreparedKeyboardButton" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static PreparedKeyboardButton SavePreparedKeyboardButton( this ITelegramBotClient client, SavePreparedKeyboardButtonArgs args ) => client.SavePreparedKeyboardButtonAsync(args).GetAwaiter().GetResult(); /// /// Stores a keyboard button that can be used by a user within a Mini App. Returns a object. /// /// The instance. /// The arguments for the "SavePreparedKeyboardButton" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SavePreparedKeyboardButtonAsync( this ITelegramBotClient client, SavePreparedKeyboardButtonArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.SavePreparedKeyboardButton, args, cancellationToken ); } /// /// Stores a keyboard button that can be used by a user within a Mini App. Returns a object. /// /// The instance. /// Unique identifier of the target user that can use the button /// A JSON-serialized object describing the button to be saved. The button must be of the type request_users, request_chat, or request_managed_bot /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static PreparedKeyboardButton SavePreparedKeyboardButton( this ITelegramBotClient client, long userId, KeyboardButton button ) => client.SavePreparedKeyboardButtonAsync(userId, button).GetAwaiter().GetResult(); /// /// Stores a keyboard button that can be used by a user within a Mini App. Returns a object. /// /// The instance. /// Unique identifier of the target user that can use the button /// A JSON-serialized object describing the button to be saved. The button must be of the type request_users, request_chat, or request_managed_bot /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SavePreparedKeyboardButtonAsync( this ITelegramBotClient client, long userId, KeyboardButton button, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId }, { PropertyNames.Button, button ?? throw new ArgumentNullException(nameof(button)) }, }; return client.CallMethodAsync( MethodNames.SavePreparedKeyboardButton, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendAnimation.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// The arguments for the "SendAnimation" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendAnimation(this ITelegramBotClient client, SendAnimationArgs args) => client.SendAnimationAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// The arguments for the "SendAnimation" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendAnimationAsync( this ITelegramBotClient client, SendAnimationArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendAnimation, args, cancellationToken); } /// /// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent animation in seconds /// Animation width /// Animation height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the animation caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the animation needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendAnimation( this ITelegramBotClient client, long chatId, InputFile animation, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, InputFile? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendAnimationAsync( chatId, animation, businessConnectionId, messageThreadId, directMessagesTopicId, duration, width, height, thumbnail, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent animation in seconds /// Animation width /// Animation height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the animation caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the animation needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendAnimationAsync( this ITelegramBotClient client, long chatId, InputFile animation, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, InputFile? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Animation, animation ?? throw new ArgumentNullException(nameof(animation)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (width is not null) { args.Add(PropertyNames.Width, width); } if (height is not null) { args.Add(PropertyNames.Height, height); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendAnimation, args, cancellationToken); } /// /// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent animation in seconds /// Animation width /// Animation height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the animation caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the animation needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendAnimation( this ITelegramBotClient client, long chatId, string animation, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, string? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null ) => client .SendAnimationAsync( chatId, animation, businessConnectionId, messageThreadId, directMessagesTopicId, duration, width, height, thumbnail, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup, files ) .GetAwaiter() .GetResult(); /// /// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent animation in seconds /// Animation width /// Animation height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the animation caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the animation needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendAnimationAsync( this ITelegramBotClient client, long chatId, string animation, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, string? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Animation, animation ?? throw new ArgumentNullException(nameof(animation)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (width is not null) { args.Add(PropertyNames.Width, width); } if (height is not null) { args.Add(PropertyNames.Height, height); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } if (files is not null) { foreach (var file in files) { args.Add(file.Key, file.Value); } } return client.CallMethodAsync(MethodNames.SendAnimation, args, cancellationToken); } /// /// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent animation in seconds /// Animation width /// Animation height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the animation caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the animation needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendAnimation( this ITelegramBotClient client, string chatId, InputFile animation, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, InputFile? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendAnimationAsync( chatId, animation, businessConnectionId, messageThreadId, directMessagesTopicId, duration, width, height, thumbnail, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent animation in seconds /// Animation width /// Animation height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the animation caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the animation needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendAnimationAsync( this ITelegramBotClient client, string chatId, InputFile animation, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, InputFile? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Animation, animation ?? throw new ArgumentNullException(nameof(animation)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (width is not null) { args.Add(PropertyNames.Width, width); } if (height is not null) { args.Add(PropertyNames.Height, height); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendAnimation, args, cancellationToken); } /// /// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent animation in seconds /// Animation width /// Animation height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the animation caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the animation needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendAnimation( this ITelegramBotClient client, string chatId, string animation, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, string? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null ) => client .SendAnimationAsync( chatId, animation, businessConnectionId, messageThreadId, directMessagesTopicId, duration, width, height, thumbnail, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup, files ) .GetAwaiter() .GetResult(); /// /// Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent animation in seconds /// Animation width /// Animation height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the animation caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the animation needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendAnimationAsync( this ITelegramBotClient client, string chatId, string animation, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, string? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Animation, animation ?? throw new ArgumentNullException(nameof(animation)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (width is not null) { args.Add(PropertyNames.Width, width); } if (height is not null) { args.Add(PropertyNames.Height, height); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } if (files is not null) { foreach (var file in files) { args.Add(file.Key, file.Value); } } return client.CallMethodAsync(MethodNames.SendAnimation, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendAudio.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. /// For sending voice messages, use the sendVoice method instead. /// /// The instance. /// The arguments for the "SendAudio" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendAudio(this ITelegramBotClient client, SendAudioArgs args) => client.SendAudioAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. /// For sending voice messages, use the sendVoice method instead. /// /// The instance. /// The arguments for the "SendAudio" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendAudioAsync( this ITelegramBotClient client, SendAudioArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendAudio, args, cancellationToken); } /// /// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. /// For sending voice messages, use the sendVoice method instead. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Audio caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the audio caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the audio in seconds /// Performer /// Track name /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendAudio( this ITelegramBotClient client, long chatId, InputFile audio, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, string? performer = null, string? title = null, InputFile? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendAudioAsync( chatId, audio, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, duration, performer, title, thumbnail, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. /// For sending voice messages, use the sendVoice method instead. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Audio caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the audio caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the audio in seconds /// Performer /// Track name /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendAudioAsync( this ITelegramBotClient client, long chatId, InputFile audio, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, string? performer = null, string? title = null, InputFile? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Audio, audio ?? throw new ArgumentNullException(nameof(audio)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (performer is not null) { args.Add(PropertyNames.Performer, performer); } if (title is not null) { args.Add(PropertyNames.Title, title); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendAudio, args, cancellationToken); } /// /// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. /// For sending voice messages, use the sendVoice method instead. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Audio caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the audio caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the audio in seconds /// Performer /// Track name /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendAudio( this ITelegramBotClient client, long chatId, string audio, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, string? performer = null, string? title = null, string? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null ) => client .SendAudioAsync( chatId, audio, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, duration, performer, title, thumbnail, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup, files ) .GetAwaiter() .GetResult(); /// /// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. /// For sending voice messages, use the sendVoice method instead. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Audio caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the audio caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the audio in seconds /// Performer /// Track name /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendAudioAsync( this ITelegramBotClient client, long chatId, string audio, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, string? performer = null, string? title = null, string? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Audio, audio ?? throw new ArgumentNullException(nameof(audio)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (performer is not null) { args.Add(PropertyNames.Performer, performer); } if (title is not null) { args.Add(PropertyNames.Title, title); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } if (files is not null) { foreach (var file in files) { args.Add(file.Key, file.Value); } } return client.CallMethodAsync(MethodNames.SendAudio, args, cancellationToken); } /// /// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. /// For sending voice messages, use the sendVoice method instead. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Audio caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the audio caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the audio in seconds /// Performer /// Track name /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendAudio( this ITelegramBotClient client, string chatId, InputFile audio, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, string? performer = null, string? title = null, InputFile? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendAudioAsync( chatId, audio, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, duration, performer, title, thumbnail, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. /// For sending voice messages, use the sendVoice method instead. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Audio caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the audio caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the audio in seconds /// Performer /// Track name /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendAudioAsync( this ITelegramBotClient client, string chatId, InputFile audio, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, string? performer = null, string? title = null, InputFile? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Audio, audio ?? throw new ArgumentNullException(nameof(audio)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (performer is not null) { args.Add(PropertyNames.Performer, performer); } if (title is not null) { args.Add(PropertyNames.Title, title); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendAudio, args, cancellationToken); } /// /// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. /// For sending voice messages, use the sendVoice method instead. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Audio caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the audio caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the audio in seconds /// Performer /// Track name /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendAudio( this ITelegramBotClient client, string chatId, string audio, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, string? performer = null, string? title = null, string? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null ) => client .SendAudioAsync( chatId, audio, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, duration, performer, title, thumbnail, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup, files ) .GetAwaiter() .GetResult(); /// /// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. /// For sending voice messages, use the sendVoice method instead. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Audio caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the audio caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the audio in seconds /// Performer /// Track name /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendAudioAsync( this ITelegramBotClient client, string chatId, string audio, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, string? performer = null, string? title = null, string? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Audio, audio ?? throw new ArgumentNullException(nameof(audio)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (performer is not null) { args.Add(PropertyNames.Performer, performer); } if (title is not null) { args.Add(PropertyNames.Title, title); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } if (files is not null) { foreach (var file in files) { args.Add(file.Key, file.Value); } } return client.CallMethodAsync(MethodNames.SendAudio, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendChatAction.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success. /// We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel chats and channel direct messages chats aren't supported. /// Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes. /// Unique identifier of the business connection on behalf of which the action will be sent /// Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SendChatAction( this ITelegramBotClient client, long chatId, string action, string? businessConnectionId = null, int? messageThreadId = null ) => client .SendChatActionAsync(chatId, action, businessConnectionId, messageThreadId) .GetAwaiter() .GetResult(); /// /// Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success. /// We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel chats and channel direct messages chats aren't supported. /// Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes. /// Unique identifier of the business connection on behalf of which the action will be sent /// Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendChatActionAsync( this ITelegramBotClient client, long chatId, string action, string? businessConnectionId = null, int? messageThreadId = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Action, action ?? throw new ArgumentNullException(nameof(action)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } return client.CallMethodAsync(MethodNames.SendChatAction, args, cancellationToken); } /// /// Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success. /// We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel chats and channel direct messages chats aren't supported. /// Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes. /// Unique identifier of the business connection on behalf of which the action will be sent /// Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SendChatAction( this ITelegramBotClient client, string chatId, string action, string? businessConnectionId = null, int? messageThreadId = null ) => client .SendChatActionAsync(chatId, action, businessConnectionId, messageThreadId) .GetAwaiter() .GetResult(); /// /// Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success. /// We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel chats and channel direct messages chats aren't supported. /// Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes. /// Unique identifier of the business connection on behalf of which the action will be sent /// Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendChatActionAsync( this ITelegramBotClient client, string chatId, string action, string? businessConnectionId = null, int? messageThreadId = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Action, action ?? throw new ArgumentNullException(nameof(action)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } return client.CallMethodAsync(MethodNames.SendChatAction, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendChecklist.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send a checklist on behalf of a connected business account. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendChecklist" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendChecklist(this ITelegramBotClient client, SendChecklistArgs args) => client.SendChecklistAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send a checklist on behalf of a connected business account. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendChecklist" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendChecklistAsync( this ITelegramBotClient client, SendChecklistArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendChecklist, args, cancellationToken); } /// /// Use this method to send a checklist on behalf of a connected business account. On success, the sent is returned. /// /// The instance. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target chat or username of the target bot in the format @username /// A JSON-serialized object for the checklist to send /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Unique identifier of the message effect to be added to the message /// A JSON-serialized object for description of the message to reply to /// A JSON-serialized object for an inline keyboard /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendChecklist( this ITelegramBotClient client, string businessConnectionId, long chatId, InputChecklist checklist, bool? disableNotification = null, bool? protectContent = null, string? messageEffectId = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendChecklistAsync( businessConnectionId, chatId, checklist, disableNotification, protectContent, messageEffectId, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send a checklist on behalf of a connected business account. On success, the sent is returned. /// /// The instance. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target chat or username of the target bot in the format @username /// A JSON-serialized object for the checklist to send /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Unique identifier of the message effect to be added to the message /// A JSON-serialized object for description of the message to reply to /// A JSON-serialized object for an inline keyboard /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendChecklistAsync( this ITelegramBotClient client, string businessConnectionId, long chatId, InputChecklist checklist, bool? disableNotification = null, bool? protectContent = null, string? messageEffectId = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.ChatId, chatId }, { PropertyNames.Checklist, checklist ?? throw new ArgumentNullException(nameof(checklist)) }, }; if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendChecklist, args, cancellationToken); } /// /// Use this method to send a checklist on behalf of a connected business account. On success, the sent is returned. /// /// The instance. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target chat or username of the target bot in the format @username /// A JSON-serialized object for the checklist to send /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Unique identifier of the message effect to be added to the message /// A JSON-serialized object for description of the message to reply to /// A JSON-serialized object for an inline keyboard /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendChecklist( this ITelegramBotClient client, string businessConnectionId, string chatId, InputChecklist checklist, bool? disableNotification = null, bool? protectContent = null, string? messageEffectId = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendChecklistAsync( businessConnectionId, chatId, checklist, disableNotification, protectContent, messageEffectId, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send a checklist on behalf of a connected business account. On success, the sent is returned. /// /// The instance. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target chat or username of the target bot in the format @username /// A JSON-serialized object for the checklist to send /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Unique identifier of the message effect to be added to the message /// A JSON-serialized object for description of the message to reply to /// A JSON-serialized object for an inline keyboard /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendChecklistAsync( this ITelegramBotClient client, string businessConnectionId, string chatId, InputChecklist checklist, bool? disableNotification = null, bool? protectContent = null, string? messageEffectId = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Checklist, checklist ?? throw new ArgumentNullException(nameof(checklist)) }, }; if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendChecklist, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendContact.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send phone contacts. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendContact" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendContact(this ITelegramBotClient client, SendContactArgs args) => client.SendContactAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send phone contacts. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendContact" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendContactAsync( this ITelegramBotClient client, SendContactArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendContact, args, cancellationToken); } /// /// Use this method to send phone contacts. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Contact's phone number /// Contact's first name /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Contact's last name /// Additional data about the contact in the form of a vCard, 0-2048 bytes /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendContact( this ITelegramBotClient client, long chatId, string phoneNumber, string firstName, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? lastName = null, string? vcard = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendContactAsync( chatId, phoneNumber, firstName, businessConnectionId, messageThreadId, directMessagesTopicId, lastName, vcard, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send phone contacts. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Contact's phone number /// Contact's first name /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Contact's last name /// Additional data about the contact in the form of a vCard, 0-2048 bytes /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendContactAsync( this ITelegramBotClient client, long chatId, string phoneNumber, string firstName, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? lastName = null, string? vcard = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.PhoneNumber, phoneNumber ?? throw new ArgumentNullException(nameof(phoneNumber)) }, { PropertyNames.FirstName, firstName ?? throw new ArgumentNullException(nameof(firstName)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (lastName is not null) { args.Add(PropertyNames.LastName, lastName); } if (vcard is not null) { args.Add(PropertyNames.Vcard, vcard); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendContact, args, cancellationToken); } /// /// Use this method to send phone contacts. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Contact's phone number /// Contact's first name /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Contact's last name /// Additional data about the contact in the form of a vCard, 0-2048 bytes /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendContact( this ITelegramBotClient client, string chatId, string phoneNumber, string firstName, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? lastName = null, string? vcard = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendContactAsync( chatId, phoneNumber, firstName, businessConnectionId, messageThreadId, directMessagesTopicId, lastName, vcard, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send phone contacts. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Contact's phone number /// Contact's first name /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Contact's last name /// Additional data about the contact in the form of a vCard, 0-2048 bytes /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendContactAsync( this ITelegramBotClient client, string chatId, string phoneNumber, string firstName, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? lastName = null, string? vcard = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.PhoneNumber, phoneNumber ?? throw new ArgumentNullException(nameof(phoneNumber)) }, { PropertyNames.FirstName, firstName ?? throw new ArgumentNullException(nameof(firstName)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (lastName is not null) { args.Add(PropertyNames.LastName, lastName); } if (vcard is not null) { args.Add(PropertyNames.Vcard, vcard); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendContact, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendDice.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send an animated emoji that will display a random value. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendDice" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendDice(this ITelegramBotClient client, SendDiceArgs args) => client.SendDiceAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send an animated emoji that will display a random value. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendDice" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendDiceAsync( this ITelegramBotClient client, SendDiceArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendDice, args, cancellationToken); } /// /// Use this method to send an animated emoji that will display a random value. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲” /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendDice( this ITelegramBotClient client, long chatId, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? emoji = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendDiceAsync( chatId, businessConnectionId, messageThreadId, directMessagesTopicId, emoji, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send an animated emoji that will display a random value. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲” /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendDiceAsync( this ITelegramBotClient client, long chatId, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? emoji = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (emoji is not null) { args.Add(PropertyNames.Emoji, emoji); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendDice, args, cancellationToken); } /// /// Use this method to send an animated emoji that will display a random value. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲” /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendDice( this ITelegramBotClient client, string chatId, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? emoji = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendDiceAsync( chatId, businessConnectionId, messageThreadId, directMessagesTopicId, emoji, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send an animated emoji that will display a random value. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲” /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendDiceAsync( this ITelegramBotClient client, string chatId, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? emoji = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (emoji is not null) { args.Add(PropertyNames.Emoji, emoji); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendDice, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendDocument.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send general files. On success, the sent is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// The arguments for the "SendDocument" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendDocument(this ITelegramBotClient client, SendDocumentArgs args) => client.SendDocumentAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send general files. On success, the sent is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// The arguments for the "SendDocument" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendDocumentAsync( this ITelegramBotClient client, SendDocumentArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendDocument, args, cancellationToken); } /// /// Use this method to send general files. On success, the sent is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the document caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Disables automatic server-side content type detection for files uploaded using multipart/form-data /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendDocument( this ITelegramBotClient client, long chatId, InputFile document, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, InputFile? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? disableContentTypeDetection = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendDocumentAsync( chatId, document, businessConnectionId, messageThreadId, directMessagesTopicId, thumbnail, caption, parseMode, captionEntities, disableContentTypeDetection, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send general files. On success, the sent is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the document caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Disables automatic server-side content type detection for files uploaded using multipart/form-data /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendDocumentAsync( this ITelegramBotClient client, long chatId, InputFile document, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, InputFile? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? disableContentTypeDetection = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Document, document ?? throw new ArgumentNullException(nameof(document)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (disableContentTypeDetection is not null) { args.Add(PropertyNames.DisableContentTypeDetection, disableContentTypeDetection); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendDocument, args, cancellationToken); } /// /// Use this method to send general files. On success, the sent is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the document caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Disables automatic server-side content type detection for files uploaded using multipart/form-data /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendDocument( this ITelegramBotClient client, long chatId, string document, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? disableContentTypeDetection = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null ) => client .SendDocumentAsync( chatId, document, businessConnectionId, messageThreadId, directMessagesTopicId, thumbnail, caption, parseMode, captionEntities, disableContentTypeDetection, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup, files ) .GetAwaiter() .GetResult(); /// /// Use this method to send general files. On success, the sent is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the document caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Disables automatic server-side content type detection for files uploaded using multipart/form-data /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendDocumentAsync( this ITelegramBotClient client, long chatId, string document, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? disableContentTypeDetection = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Document, document ?? throw new ArgumentNullException(nameof(document)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (disableContentTypeDetection is not null) { args.Add(PropertyNames.DisableContentTypeDetection, disableContentTypeDetection); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } if (files is not null) { foreach (var file in files) { args.Add(file.Key, file.Value); } } return client.CallMethodAsync(MethodNames.SendDocument, args, cancellationToken); } /// /// Use this method to send general files. On success, the sent is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the document caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Disables automatic server-side content type detection for files uploaded using multipart/form-data /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendDocument( this ITelegramBotClient client, string chatId, InputFile document, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, InputFile? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? disableContentTypeDetection = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendDocumentAsync( chatId, document, businessConnectionId, messageThreadId, directMessagesTopicId, thumbnail, caption, parseMode, captionEntities, disableContentTypeDetection, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send general files. On success, the sent is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the document caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Disables automatic server-side content type detection for files uploaded using multipart/form-data /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendDocumentAsync( this ITelegramBotClient client, string chatId, InputFile document, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, InputFile? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? disableContentTypeDetection = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Document, document ?? throw new ArgumentNullException(nameof(document)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (disableContentTypeDetection is not null) { args.Add(PropertyNames.DisableContentTypeDetection, disableContentTypeDetection); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendDocument, args, cancellationToken); } /// /// Use this method to send general files. On success, the sent is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the document caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Disables automatic server-side content type detection for files uploaded using multipart/form-data /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendDocument( this ITelegramBotClient client, string chatId, string document, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? disableContentTypeDetection = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null ) => client .SendDocumentAsync( chatId, document, businessConnectionId, messageThreadId, directMessagesTopicId, thumbnail, caption, parseMode, captionEntities, disableContentTypeDetection, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup, files ) .GetAwaiter() .GetResult(); /// /// Use this method to send general files. On success, the sent is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the document caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Disables automatic server-side content type detection for files uploaded using multipart/form-data /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendDocumentAsync( this ITelegramBotClient client, string chatId, string document, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? thumbnail = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? disableContentTypeDetection = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Document, document ?? throw new ArgumentNullException(nameof(document)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (disableContentTypeDetection is not null) { args.Add(PropertyNames.DisableContentTypeDetection, disableContentTypeDetection); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } if (files is not null) { foreach (var file in files) { args.Add(file.Key, file.Value); } } return client.CallMethodAsync(MethodNames.SendDocument, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendGift.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success. /// /// The instance. /// The arguments for the "SendGift" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SendGift(this ITelegramBotClient client, SendGiftArgs args) => client.SendGiftAsync(args).GetAwaiter().GetResult(); /// /// Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success. /// /// The instance. /// The arguments for the "SendGift" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendGiftAsync( this ITelegramBotClient client, SendGiftArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendGift, args, cancellationToken); } /// /// Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success. /// /// The instance. /// Identifier of the gift; limited gifts can't be sent to channel chats /// Required if chat_id is not specified. Unique identifier of the target user who will receive the gift. /// Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @username) that will receive the gift. /// Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver /// Text that will be shown along with the gift; 0-128 characters /// Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored. /// A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SendGift( this ITelegramBotClient client, string giftId, long? userId = null, long? chatId = null, bool? payForUpgrade = null, string? text = null, string? textParseMode = null, IEnumerable? textEntities = null ) => client .SendGiftAsync(giftId, userId, chatId, payForUpgrade, text, textParseMode, textEntities) .GetAwaiter() .GetResult(); /// /// Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success. /// /// The instance. /// Identifier of the gift; limited gifts can't be sent to channel chats /// Required if chat_id is not specified. Unique identifier of the target user who will receive the gift. /// Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @username) that will receive the gift. /// Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver /// Text that will be shown along with the gift; 0-128 characters /// Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored. /// A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendGiftAsync( this ITelegramBotClient client, string giftId, long? userId = null, long? chatId = null, bool? payForUpgrade = null, string? text = null, string? textParseMode = null, IEnumerable? textEntities = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.GiftId, giftId ?? throw new ArgumentNullException(nameof(giftId)) }, }; if (userId is not null) { args.Add(PropertyNames.UserId, userId); } if (chatId is not null) { args.Add(PropertyNames.ChatId, chatId); } if (payForUpgrade is not null) { args.Add(PropertyNames.PayForUpgrade, payForUpgrade); } if (text is not null) { args.Add(PropertyNames.Text, text); } if (textParseMode is not null) { args.Add(PropertyNames.TextParseMode, textParseMode); } if (textEntities is not null) { args.Add(PropertyNames.TextEntities, textEntities); } return client.CallMethodAsync(MethodNames.SendGift, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendLivePhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendLivePhoto" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendLivePhoto(this ITelegramBotClient client, SendLivePhotoArgs args) => client.SendLivePhotoAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendLivePhoto" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendLivePhotoAsync( this ITelegramBotClient client, SendLivePhotoArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendLivePhoto, args, cancellationToken); } /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendLivePhoto( this ITelegramBotClient client, long chatId, InputFile livePhoto, InputFile photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendLivePhotoAsync( chatId, livePhoto, photo, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendLivePhotoAsync( this ITelegramBotClient client, long chatId, InputFile livePhoto, InputFile photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.LivePhoto, livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)) }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendLivePhoto, args, cancellationToken); } /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendLivePhoto( this ITelegramBotClient client, long chatId, InputFile livePhoto, string photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendLivePhotoAsync( chatId, livePhoto, photo, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendLivePhotoAsync( this ITelegramBotClient client, long chatId, InputFile livePhoto, string photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.LivePhoto, livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)) }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendLivePhoto, args, cancellationToken); } /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendLivePhoto( this ITelegramBotClient client, long chatId, string livePhoto, InputFile photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendLivePhotoAsync( chatId, livePhoto, photo, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendLivePhotoAsync( this ITelegramBotClient client, long chatId, string livePhoto, InputFile photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.LivePhoto, livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)) }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendLivePhoto, args, cancellationToken); } /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendLivePhoto( this ITelegramBotClient client, long chatId, string livePhoto, string photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendLivePhotoAsync( chatId, livePhoto, photo, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendLivePhotoAsync( this ITelegramBotClient client, long chatId, string livePhoto, string photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.LivePhoto, livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)) }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendLivePhoto, args, cancellationToken); } /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendLivePhoto( this ITelegramBotClient client, string chatId, InputFile livePhoto, InputFile photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendLivePhotoAsync( chatId, livePhoto, photo, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendLivePhotoAsync( this ITelegramBotClient client, string chatId, InputFile livePhoto, InputFile photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.LivePhoto, livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)) }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendLivePhoto, args, cancellationToken); } /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendLivePhoto( this ITelegramBotClient client, string chatId, InputFile livePhoto, string photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendLivePhotoAsync( chatId, livePhoto, photo, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendLivePhotoAsync( this ITelegramBotClient client, string chatId, InputFile livePhoto, string photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.LivePhoto, livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)) }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendLivePhoto, args, cancellationToken); } /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendLivePhoto( this ITelegramBotClient client, string chatId, string livePhoto, InputFile photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendLivePhotoAsync( chatId, livePhoto, photo, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendLivePhotoAsync( this ITelegramBotClient client, string chatId, string livePhoto, InputFile photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.LivePhoto, livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)) }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendLivePhoto, args, cancellationToken); } /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendLivePhoto( this ITelegramBotClient client, string chatId, string livePhoto, string photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendLivePhotoAsync( chatId, livePhoto, photo, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send live photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target channel (in the format @channelusername) /// Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendLivePhotoAsync( this ITelegramBotClient client, string chatId, string livePhoto, string photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.LivePhoto, livePhoto ?? throw new ArgumentNullException(nameof(livePhoto)) }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendLivePhoto, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendLocation.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send point on the map. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendLocation" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendLocation(this ITelegramBotClient client, SendLocationArgs args) => client.SendLocationAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send point on the map. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendLocation" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendLocationAsync( this ITelegramBotClient client, SendLocationArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendLocation, args, cancellationToken); } /// /// Use this method to send point on the map. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Latitude of the location /// Longitude of the location /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// The radius of uncertainty for the location, measured in meters; 0-1500 /// Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. /// For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. /// For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendLocation( this ITelegramBotClient client, long chatId, float latitude, float longitude, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, float? horizontalAccuracy = null, int? livePeriod = null, int? heading = null, int? proximityAlertRadius = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendLocationAsync( chatId, latitude, longitude, businessConnectionId, messageThreadId, directMessagesTopicId, horizontalAccuracy, livePeriod, heading, proximityAlertRadius, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send point on the map. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Latitude of the location /// Longitude of the location /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// The radius of uncertainty for the location, measured in meters; 0-1500 /// Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. /// For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. /// For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendLocationAsync( this ITelegramBotClient client, long chatId, float latitude, float longitude, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, float? horizontalAccuracy = null, int? livePeriod = null, int? heading = null, int? proximityAlertRadius = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Latitude, latitude }, { PropertyNames.Longitude, longitude }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (horizontalAccuracy is not null) { args.Add(PropertyNames.HorizontalAccuracy, horizontalAccuracy); } if (livePeriod is not null) { args.Add(PropertyNames.LivePeriod, livePeriod); } if (heading is not null) { args.Add(PropertyNames.Heading, heading); } if (proximityAlertRadius is not null) { args.Add(PropertyNames.ProximityAlertRadius, proximityAlertRadius); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendLocation, args, cancellationToken); } /// /// Use this method to send point on the map. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Latitude of the location /// Longitude of the location /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// The radius of uncertainty for the location, measured in meters; 0-1500 /// Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. /// For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. /// For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendLocation( this ITelegramBotClient client, string chatId, float latitude, float longitude, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, float? horizontalAccuracy = null, int? livePeriod = null, int? heading = null, int? proximityAlertRadius = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendLocationAsync( chatId, latitude, longitude, businessConnectionId, messageThreadId, directMessagesTopicId, horizontalAccuracy, livePeriod, heading, proximityAlertRadius, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send point on the map. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Latitude of the location /// Longitude of the location /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// The radius of uncertainty for the location, measured in meters; 0-1500 /// Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. /// For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. /// For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendLocationAsync( this ITelegramBotClient client, string chatId, float latitude, float longitude, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, float? horizontalAccuracy = null, int? livePeriod = null, int? heading = null, int? proximityAlertRadius = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Latitude, latitude }, { PropertyNames.Longitude, longitude }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (horizontalAccuracy is not null) { args.Add(PropertyNames.HorizontalAccuracy, horizontalAccuracy); } if (livePeriod is not null) { args.Add(PropertyNames.LivePeriod, livePeriod); } if (heading is not null) { args.Add(PropertyNames.Heading, heading); } if (proximityAlertRadius is not null) { args.Add(PropertyNames.ProximityAlertRadius, proximityAlertRadius); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendLocation, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendMediaGroup.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of objects that were sent is returned. /// /// The instance. /// The arguments for the "SendMediaGroup" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable SendMediaGroup( this ITelegramBotClient client, SendMediaGroupArgs args ) => client.SendMediaGroupAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of objects that were sent is returned. /// /// The instance. /// The arguments for the "SendMediaGroup" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> SendMediaGroupAsync( this ITelegramBotClient client, SendMediaGroupArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync>( MethodNames.SendMediaGroup, args, cancellationToken ); } /// /// Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of objects that were sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// Sends messages silently. Users will receive a notification with no sound. /// Protects the contents of the sent messages from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// Description of the message to reply to /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable SendMediaGroup( this ITelegramBotClient client, long chatId, IEnumerable media, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, ReplyParameters? replyParameters = null ) => client .SendMediaGroupAsync( chatId, media, businessConnectionId, messageThreadId, directMessagesTopicId, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, replyParameters ) .GetAwaiter() .GetResult(); /// /// Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of objects that were sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// Sends messages silently. Users will receive a notification with no sound. /// Protects the contents of the sent messages from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// Description of the message to reply to /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> SendMediaGroupAsync( this ITelegramBotClient client, long chatId, IEnumerable media, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, ReplyParameters? replyParameters = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Media, media ?? throw new ArgumentNullException(nameof(media)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } return client.CallMethodAsync>( MethodNames.SendMediaGroup, args, cancellationToken ); } /// /// Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of objects that were sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// Sends messages silently. Users will receive a notification with no sound. /// Protects the contents of the sent messages from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// Description of the message to reply to /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static IEnumerable SendMediaGroup( this ITelegramBotClient client, string chatId, IEnumerable media, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, ReplyParameters? replyParameters = null ) => client .SendMediaGroupAsync( chatId, media, businessConnectionId, messageThreadId, directMessagesTopicId, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, replyParameters ) .GetAwaiter() .GetResult(); /// /// Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of objects that were sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// A JSON-serialized array describing messages to be sent, must include 2-10 items /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat /// Sends messages silently. Users will receive a notification with no sound. /// Protects the contents of the sent messages from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// Description of the message to reply to /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task> SendMediaGroupAsync( this ITelegramBotClient client, string chatId, IEnumerable media, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, ReplyParameters? replyParameters = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Media, media ?? throw new ArgumentNullException(nameof(media)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } return client.CallMethodAsync>( MethodNames.SendMediaGroup, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendMessage.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send text messages. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendMessage" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendMessage(this ITelegramBotClient client, SendMessageArgs args) => client.SendMessageAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send text messages. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendMessage" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendMessageAsync( this ITelegramBotClient client, SendMessageArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendMessage, args, cancellationToken); } /// /// Use this method to send text messages. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Text of the message to be sent, 1-4096 characters after entities parsing /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Mode for parsing entities in the message text. See formatting options for more details. /// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode /// Link preview generation options for the message /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendMessage( this ITelegramBotClient client, long chatId, string text, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? parseMode = null, IEnumerable? entities = null, LinkPreviewOptions? linkPreviewOptions = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendMessageAsync( chatId, text, businessConnectionId, messageThreadId, directMessagesTopicId, parseMode, entities, linkPreviewOptions, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send text messages. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Text of the message to be sent, 1-4096 characters after entities parsing /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Mode for parsing entities in the message text. See formatting options for more details. /// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode /// Link preview generation options for the message /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendMessageAsync( this ITelegramBotClient client, long chatId, string text, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? parseMode = null, IEnumerable? entities = null, LinkPreviewOptions? linkPreviewOptions = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Text, text ?? throw new ArgumentNullException(nameof(text)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (entities is not null) { args.Add(PropertyNames.Entities, entities); } if (linkPreviewOptions is not null) { args.Add(PropertyNames.LinkPreviewOptions, linkPreviewOptions); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendMessage, args, cancellationToken); } /// /// Use this method to send text messages. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Text of the message to be sent, 1-4096 characters after entities parsing /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Mode for parsing entities in the message text. See formatting options for more details. /// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode /// Link preview generation options for the message /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendMessage( this ITelegramBotClient client, string chatId, string text, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? parseMode = null, IEnumerable? entities = null, LinkPreviewOptions? linkPreviewOptions = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendMessageAsync( chatId, text, businessConnectionId, messageThreadId, directMessagesTopicId, parseMode, entities, linkPreviewOptions, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send text messages. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Text of the message to be sent, 1-4096 characters after entities parsing /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Mode for parsing entities in the message text. See formatting options for more details. /// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode /// Link preview generation options for the message /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendMessageAsync( this ITelegramBotClient client, string chatId, string text, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? parseMode = null, IEnumerable? entities = null, LinkPreviewOptions? linkPreviewOptions = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Text, text ?? throw new ArgumentNullException(nameof(text)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (entities is not null) { args.Add(PropertyNames.Entities, entities); } if (linkPreviewOptions is not null) { args.Add(PropertyNames.LinkPreviewOptions, linkPreviewOptions); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendMessage, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendMessageDraft.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to stream a partial message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you must call sendMessage with the complete message to persist it in the user's chat. Returns True on success. /// /// The instance. /// The arguments for the "SendMessageDraft" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SendMessageDraft( this ITelegramBotClient client, SendMessageDraftArgs args ) => client.SendMessageDraftAsync(args).GetAwaiter().GetResult(); /// /// Use this method to stream a partial message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you must call sendMessage with the complete message to persist it in the user's chat. Returns True on success. /// /// The instance. /// The arguments for the "SendMessageDraft" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendMessageDraftAsync( this ITelegramBotClient client, SendMessageDraftArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendMessageDraft, args, cancellationToken); } /// /// Use this method to stream a partial message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you must call sendMessage with the complete message to persist it in the user's chat. Returns True on success. /// /// The instance. /// Unique identifier for the target private chat /// Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated. /// Unique identifier for the target message thread /// Text of the message to be sent, 0-4096 characters after entities parsing. Pass an empty text to show a “Thinking…” placeholder. /// Mode for parsing entities in the message text. See formatting options for more details. /// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SendMessageDraft( this ITelegramBotClient client, long chatId, int draftId, int? messageThreadId = null, string? text = null, string? parseMode = null, IEnumerable? entities = null ) => client .SendMessageDraftAsync(chatId, draftId, messageThreadId, text, parseMode, entities) .GetAwaiter() .GetResult(); /// /// Use this method to stream a partial message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you must call sendMessage with the complete message to persist it in the user's chat. Returns True on success. /// /// The instance. /// Unique identifier for the target private chat /// Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated. /// Unique identifier for the target message thread /// Text of the message to be sent, 0-4096 characters after entities parsing. Pass an empty text to show a “Thinking…” placeholder. /// Mode for parsing entities in the message text. See formatting options for more details. /// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendMessageDraftAsync( this ITelegramBotClient client, long chatId, int draftId, int? messageThreadId = null, string? text = null, string? parseMode = null, IEnumerable? entities = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.DraftId, draftId }, }; if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (text is not null) { args.Add(PropertyNames.Text, text); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (entities is not null) { args.Add(PropertyNames.Entities, entities); } return client.CallMethodAsync(MethodNames.SendMessageDraft, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendPaidMedia.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send paid media. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendPaidMedia" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendPaidMedia(this ITelegramBotClient client, SendPaidMediaArgs args) => client.SendPaidMediaAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send paid media. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendPaidMedia" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendPaidMediaAsync( this ITelegramBotClient client, SendPaidMediaArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendPaidMedia, args, cancellationToken); } /// /// Use this method to send paid media. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. /// The number of Telegram Stars that must be paid to buy access to the media; 1-25000 /// A JSON-serialized array describing the media to be sent; up to 10 items /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. /// Media caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the media caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendPaidMedia( this ITelegramBotClient client, long chatId, int starCount, IEnumerable media, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? payload = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendPaidMediaAsync( chatId, starCount, media, businessConnectionId, messageThreadId, directMessagesTopicId, payload, caption, parseMode, captionEntities, showCaptionAboveMedia, disableNotification, protectContent, allowPaidBroadcast, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send paid media. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. /// The number of Telegram Stars that must be paid to buy access to the media; 1-25000 /// A JSON-serialized array describing the media to be sent; up to 10 items /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. /// Media caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the media caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendPaidMediaAsync( this ITelegramBotClient client, long chatId, int starCount, IEnumerable media, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? payload = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.StarCount, starCount }, { PropertyNames.Media, media ?? throw new ArgumentNullException(nameof(media)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (payload is not null) { args.Add(PropertyNames.Payload, payload); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendPaidMedia, args, cancellationToken); } /// /// Use this method to send paid media. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. /// The number of Telegram Stars that must be paid to buy access to the media; 1-25000 /// A JSON-serialized array describing the media to be sent; up to 10 items /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. /// Media caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the media caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendPaidMedia( this ITelegramBotClient client, string chatId, int starCount, IEnumerable media, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? payload = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendPaidMediaAsync( chatId, starCount, media, businessConnectionId, messageThreadId, directMessagesTopicId, payload, caption, parseMode, captionEntities, showCaptionAboveMedia, disableNotification, protectContent, allowPaidBroadcast, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send paid media. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. /// The number of Telegram Stars that must be paid to buy access to the media; 1-25000 /// A JSON-serialized array describing the media to be sent; up to 10 items /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. /// Media caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the media caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendPaidMediaAsync( this ITelegramBotClient client, string chatId, int starCount, IEnumerable media, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? payload = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.StarCount, starCount }, { PropertyNames.Media, media ?? throw new ArgumentNullException(nameof(media)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (payload is not null) { args.Add(PropertyNames.Payload, payload); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendPaidMedia, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendPhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send photos. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendPhoto" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendPhoto(this ITelegramBotClient client, SendPhotoArgs args) => client.SendPhotoAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send photos. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendPhoto" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendPhotoAsync( this ITelegramBotClient client, SendPhotoArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendPhoto, args, cancellationToken); } /// /// Use this method to send photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the photo caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the photo needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendPhoto( this ITelegramBotClient client, long chatId, InputFile photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendPhotoAsync( chatId, photo, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the photo caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the photo needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendPhotoAsync( this ITelegramBotClient client, long chatId, InputFile photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendPhoto, args, cancellationToken); } /// /// Use this method to send photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the photo caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the photo needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendPhoto( this ITelegramBotClient client, long chatId, string photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendPhotoAsync( chatId, photo, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the photo caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the photo needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendPhotoAsync( this ITelegramBotClient client, long chatId, string photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendPhoto, args, cancellationToken); } /// /// Use this method to send photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the photo caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the photo needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendPhoto( this ITelegramBotClient client, string chatId, InputFile photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendPhotoAsync( chatId, photo, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the photo caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the photo needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendPhotoAsync( this ITelegramBotClient client, string chatId, InputFile photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendPhoto, args, cancellationToken); } /// /// Use this method to send photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the photo caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the photo needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendPhoto( this ITelegramBotClient client, string chatId, string photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendPhotoAsync( chatId, photo, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send photos. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the photo caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the photo needs to be covered with a spoiler animation /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendPhotoAsync( this ITelegramBotClient client, string chatId, string photo, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendPhoto, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendPoll.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; using InputPollMedia = Telegram.BotAPI.AvailableTypes.InputMedia; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send a native poll. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendPoll" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendPoll(this ITelegramBotClient client, SendPollArgs args) => client.SendPollAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send a native poll. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendPoll" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendPollAsync( this ITelegramBotClient client, SendPollArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendPoll, args, cancellationToken); } /// /// Use this method to send a native poll. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats. /// Poll question, 1-300 characters /// A JSON-serialized list of 1-12 answer options /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed /// A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode /// True, if the poll needs to be anonymous, defaults to True /// Poll type, “quiz” or “regular”, defaults to “regular” /// Pass True, if the poll allows multiple answers, defaults to False /// Pass True, if the poll allows to change chosen answer options, defaults to False for quizzes and to True for regular polls /// Pass True, if the poll options must be shown in random order /// Pass True, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes /// Pass True, if poll results must be shown only after the poll closes /// Pass True, if voting is limited to users who have been members of the chat where the poll is being sent for more than 24 hours; for channel chats only /// A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. If omitted or empty, then users from any country can participate in the poll. /// A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode /// Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing /// Mode for parsing entities in the explanation. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode /// Media added to the quiz explanation /// Amount of time in seconds the poll will be active after creation, 5-2628000. Can't be used together with close_date. /// Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 2628000 seconds in the future. Can't be used together with open_period. /// Pass True if the poll needs to be immediately closed. This can be useful for poll preview. /// Description of the poll to be sent, 0-1024 characters after entities parsing /// Mode for parsing entities in the poll description. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of description_parse_mode /// Media added to the poll description /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendPoll( this ITelegramBotClient client, long chatId, string question, IEnumerable options, string? businessConnectionId = null, int? messageThreadId = null, string? questionParseMode = null, IEnumerable? questionEntities = null, bool? isAnonymous = null, string? type = null, bool? allowsMultipleAnswers = null, bool? allowsRevoting = null, bool? shuffleOptions = null, bool? allowAddingOptions = null, bool? hideResultsUntilCloses = null, bool? membersOnly = null, IEnumerable? countryCodes = null, IEnumerable? correctOptionIds = null, string? explanation = null, string? explanationParseMode = null, IEnumerable? explanationEntities = null, InputPollMedia? explanationMedia = null, int? openPeriod = null, int? closeDate = null, bool? isClosed = null, string? description = null, string? descriptionParseMode = null, IEnumerable? descriptionEntities = null, InputPollMedia? media = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendPollAsync( chatId, question, options, businessConnectionId, messageThreadId, questionParseMode, questionEntities, isAnonymous, type, allowsMultipleAnswers, allowsRevoting, shuffleOptions, allowAddingOptions, hideResultsUntilCloses, membersOnly, countryCodes, correctOptionIds, explanation, explanationParseMode, explanationEntities, explanationMedia, openPeriod, closeDate, isClosed, description, descriptionParseMode, descriptionEntities, media, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send a native poll. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats. /// Poll question, 1-300 characters /// A JSON-serialized list of 1-12 answer options /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed /// A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode /// True, if the poll needs to be anonymous, defaults to True /// Poll type, “quiz” or “regular”, defaults to “regular” /// Pass True, if the poll allows multiple answers, defaults to False /// Pass True, if the poll allows to change chosen answer options, defaults to False for quizzes and to True for regular polls /// Pass True, if the poll options must be shown in random order /// Pass True, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes /// Pass True, if poll results must be shown only after the poll closes /// Pass True, if voting is limited to users who have been members of the chat where the poll is being sent for more than 24 hours; for channel chats only /// A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. If omitted or empty, then users from any country can participate in the poll. /// A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode /// Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing /// Mode for parsing entities in the explanation. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode /// Media added to the quiz explanation /// Amount of time in seconds the poll will be active after creation, 5-2628000. Can't be used together with close_date. /// Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 2628000 seconds in the future. Can't be used together with open_period. /// Pass True if the poll needs to be immediately closed. This can be useful for poll preview. /// Description of the poll to be sent, 0-1024 characters after entities parsing /// Mode for parsing entities in the poll description. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of description_parse_mode /// Media added to the poll description /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendPollAsync( this ITelegramBotClient client, long chatId, string question, IEnumerable options, string? businessConnectionId = null, int? messageThreadId = null, string? questionParseMode = null, IEnumerable? questionEntities = null, bool? isAnonymous = null, string? type = null, bool? allowsMultipleAnswers = null, bool? allowsRevoting = null, bool? shuffleOptions = null, bool? allowAddingOptions = null, bool? hideResultsUntilCloses = null, bool? membersOnly = null, IEnumerable? countryCodes = null, IEnumerable? correctOptionIds = null, string? explanation = null, string? explanationParseMode = null, IEnumerable? explanationEntities = null, InputPollMedia? explanationMedia = null, int? openPeriod = null, int? closeDate = null, bool? isClosed = null, string? description = null, string? descriptionParseMode = null, IEnumerable? descriptionEntities = null, InputPollMedia? media = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Question, question ?? throw new ArgumentNullException(nameof(question)) }, { PropertyNames.Options, options ?? throw new ArgumentNullException(nameof(options)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (questionParseMode is not null) { args.Add(PropertyNames.QuestionParseMode, questionParseMode); } if (questionEntities is not null) { args.Add(PropertyNames.QuestionEntities, questionEntities); } if (isAnonymous is not null) { args.Add(PropertyNames.IsAnonymous, isAnonymous); } if (type is not null) { args.Add(PropertyNames.Type, type); } if (allowsMultipleAnswers is not null) { args.Add(PropertyNames.AllowsMultipleAnswers, allowsMultipleAnswers); } if (allowsRevoting is not null) { args.Add(PropertyNames.AllowsRevoting, allowsRevoting); } if (shuffleOptions is not null) { args.Add(PropertyNames.ShuffleOptions, shuffleOptions); } if (allowAddingOptions is not null) { args.Add(PropertyNames.AllowAddingOptions, allowAddingOptions); } if (hideResultsUntilCloses is not null) { args.Add(PropertyNames.HideResultsUntilCloses, hideResultsUntilCloses); } if (membersOnly is not null) { args.Add(PropertyNames.MembersOnly, membersOnly); } if (countryCodes is not null) { args.Add(PropertyNames.CountryCodes, countryCodes); } if (correctOptionIds is not null) { args.Add(PropertyNames.CorrectOptionIds, correctOptionIds); } if (explanation is not null) { args.Add(PropertyNames.Explanation, explanation); } if (explanationParseMode is not null) { args.Add(PropertyNames.ExplanationParseMode, explanationParseMode); } if (explanationEntities is not null) { args.Add(PropertyNames.ExplanationEntities, explanationEntities); } if (explanationMedia is not null) { args.Add(PropertyNames.ExplanationMedia, explanationMedia); } if (openPeriod is not null) { args.Add(PropertyNames.OpenPeriod, openPeriod); } if (closeDate is not null) { args.Add(PropertyNames.CloseDate, closeDate); } if (isClosed is not null) { args.Add(PropertyNames.IsClosed, isClosed); } if (description is not null) { args.Add(PropertyNames.Description, description); } if (descriptionParseMode is not null) { args.Add(PropertyNames.DescriptionParseMode, descriptionParseMode); } if (descriptionEntities is not null) { args.Add(PropertyNames.DescriptionEntities, descriptionEntities); } if (media is not null) { args.Add(PropertyNames.Media, media); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendPoll, args, cancellationToken); } /// /// Use this method to send a native poll. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats. /// Poll question, 1-300 characters /// A JSON-serialized list of 1-12 answer options /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed /// A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode /// True, if the poll needs to be anonymous, defaults to True /// Poll type, “quiz” or “regular”, defaults to “regular” /// Pass True, if the poll allows multiple answers, defaults to False /// Pass True, if the poll allows to change chosen answer options, defaults to False for quizzes and to True for regular polls /// Pass True, if the poll options must be shown in random order /// Pass True, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes /// Pass True, if poll results must be shown only after the poll closes /// Pass True, if voting is limited to users who have been members of the chat where the poll is being sent for more than 24 hours; for channel chats only /// A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. If omitted or empty, then users from any country can participate in the poll. /// A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode /// Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing /// Mode for parsing entities in the explanation. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode /// Media added to the quiz explanation /// Amount of time in seconds the poll will be active after creation, 5-2628000. Can't be used together with close_date. /// Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 2628000 seconds in the future. Can't be used together with open_period. /// Pass True if the poll needs to be immediately closed. This can be useful for poll preview. /// Description of the poll to be sent, 0-1024 characters after entities parsing /// Mode for parsing entities in the poll description. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of description_parse_mode /// Media added to the poll description /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendPoll( this ITelegramBotClient client, string chatId, string question, IEnumerable options, string? businessConnectionId = null, int? messageThreadId = null, string? questionParseMode = null, IEnumerable? questionEntities = null, bool? isAnonymous = null, string? type = null, bool? allowsMultipleAnswers = null, bool? allowsRevoting = null, bool? shuffleOptions = null, bool? allowAddingOptions = null, bool? hideResultsUntilCloses = null, bool? membersOnly = null, IEnumerable? countryCodes = null, IEnumerable? correctOptionIds = null, string? explanation = null, string? explanationParseMode = null, IEnumerable? explanationEntities = null, InputPollMedia? explanationMedia = null, int? openPeriod = null, int? closeDate = null, bool? isClosed = null, string? description = null, string? descriptionParseMode = null, IEnumerable? descriptionEntities = null, InputPollMedia? media = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendPollAsync( chatId, question, options, businessConnectionId, messageThreadId, questionParseMode, questionEntities, isAnonymous, type, allowsMultipleAnswers, allowsRevoting, shuffleOptions, allowAddingOptions, hideResultsUntilCloses, membersOnly, countryCodes, correctOptionIds, explanation, explanationParseMode, explanationEntities, explanationMedia, openPeriod, closeDate, isClosed, description, descriptionParseMode, descriptionEntities, media, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send a native poll. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats. /// Poll question, 1-300 characters /// A JSON-serialized list of 1-12 answer options /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed /// A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode /// True, if the poll needs to be anonymous, defaults to True /// Poll type, “quiz” or “regular”, defaults to “regular” /// Pass True, if the poll allows multiple answers, defaults to False /// Pass True, if the poll allows to change chosen answer options, defaults to False for quizzes and to True for regular polls /// Pass True, if the poll options must be shown in random order /// Pass True, if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes /// Pass True, if poll results must be shown only after the poll closes /// Pass True, if voting is limited to users who have been members of the chat where the poll is being sent for more than 24 hours; for channel chats only /// A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. If omitted or empty, then users from any country can participate in the poll. /// A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode /// Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing /// Mode for parsing entities in the explanation. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode /// Media added to the quiz explanation /// Amount of time in seconds the poll will be active after creation, 5-2628000. Can't be used together with close_date. /// Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 2628000 seconds in the future. Can't be used together with open_period. /// Pass True if the poll needs to be immediately closed. This can be useful for poll preview. /// Description of the poll to be sent, 0-1024 characters after entities parsing /// Mode for parsing entities in the poll description. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of description_parse_mode /// Media added to the poll description /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendPollAsync( this ITelegramBotClient client, string chatId, string question, IEnumerable options, string? businessConnectionId = null, int? messageThreadId = null, string? questionParseMode = null, IEnumerable? questionEntities = null, bool? isAnonymous = null, string? type = null, bool? allowsMultipleAnswers = null, bool? allowsRevoting = null, bool? shuffleOptions = null, bool? allowAddingOptions = null, bool? hideResultsUntilCloses = null, bool? membersOnly = null, IEnumerable? countryCodes = null, IEnumerable? correctOptionIds = null, string? explanation = null, string? explanationParseMode = null, IEnumerable? explanationEntities = null, InputPollMedia? explanationMedia = null, int? openPeriod = null, int? closeDate = null, bool? isClosed = null, string? description = null, string? descriptionParseMode = null, IEnumerable? descriptionEntities = null, InputPollMedia? media = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Question, question ?? throw new ArgumentNullException(nameof(question)) }, { PropertyNames.Options, options ?? throw new ArgumentNullException(nameof(options)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (questionParseMode is not null) { args.Add(PropertyNames.QuestionParseMode, questionParseMode); } if (questionEntities is not null) { args.Add(PropertyNames.QuestionEntities, questionEntities); } if (isAnonymous is not null) { args.Add(PropertyNames.IsAnonymous, isAnonymous); } if (type is not null) { args.Add(PropertyNames.Type, type); } if (allowsMultipleAnswers is not null) { args.Add(PropertyNames.AllowsMultipleAnswers, allowsMultipleAnswers); } if (allowsRevoting is not null) { args.Add(PropertyNames.AllowsRevoting, allowsRevoting); } if (shuffleOptions is not null) { args.Add(PropertyNames.ShuffleOptions, shuffleOptions); } if (allowAddingOptions is not null) { args.Add(PropertyNames.AllowAddingOptions, allowAddingOptions); } if (hideResultsUntilCloses is not null) { args.Add(PropertyNames.HideResultsUntilCloses, hideResultsUntilCloses); } if (membersOnly is not null) { args.Add(PropertyNames.MembersOnly, membersOnly); } if (countryCodes is not null) { args.Add(PropertyNames.CountryCodes, countryCodes); } if (correctOptionIds is not null) { args.Add(PropertyNames.CorrectOptionIds, correctOptionIds); } if (explanation is not null) { args.Add(PropertyNames.Explanation, explanation); } if (explanationParseMode is not null) { args.Add(PropertyNames.ExplanationParseMode, explanationParseMode); } if (explanationEntities is not null) { args.Add(PropertyNames.ExplanationEntities, explanationEntities); } if (explanationMedia is not null) { args.Add(PropertyNames.ExplanationMedia, explanationMedia); } if (openPeriod is not null) { args.Add(PropertyNames.OpenPeriod, openPeriod); } if (closeDate is not null) { args.Add(PropertyNames.CloseDate, closeDate); } if (isClosed is not null) { args.Add(PropertyNames.IsClosed, isClosed); } if (description is not null) { args.Add(PropertyNames.Description, description); } if (descriptionParseMode is not null) { args.Add(PropertyNames.DescriptionParseMode, descriptionParseMode); } if (descriptionEntities is not null) { args.Add(PropertyNames.DescriptionEntities, descriptionEntities); } if (media is not null) { args.Add(PropertyNames.Media, media); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendPoll, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendVenue.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send information about a venue. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendVenue" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVenue(this ITelegramBotClient client, SendVenueArgs args) => client.SendVenueAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send information about a venue. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendVenue" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVenueAsync( this ITelegramBotClient client, SendVenueArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendVenue, args, cancellationToken); } /// /// Use this method to send information about a venue. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Latitude of the venue /// Longitude of the venue /// Name of the venue /// Address of the venue /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Foursquare identifier of the venue /// Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) /// Google Places identifier of the venue /// Google Places type of the venue. (See supported types.) /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVenue( this ITelegramBotClient client, long chatId, float latitude, float longitude, string title, string address, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? foursquareId = null, string? foursquareType = null, string? googlePlaceId = null, string? googlePlaceType = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendVenueAsync( chatId, latitude, longitude, title, address, businessConnectionId, messageThreadId, directMessagesTopicId, foursquareId, foursquareType, googlePlaceId, googlePlaceType, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send information about a venue. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Latitude of the venue /// Longitude of the venue /// Name of the venue /// Address of the venue /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Foursquare identifier of the venue /// Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) /// Google Places identifier of the venue /// Google Places type of the venue. (See supported types.) /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVenueAsync( this ITelegramBotClient client, long chatId, float latitude, float longitude, string title, string address, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? foursquareId = null, string? foursquareType = null, string? googlePlaceId = null, string? googlePlaceType = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Latitude, latitude }, { PropertyNames.Longitude, longitude }, { PropertyNames.Title, title ?? throw new ArgumentNullException(nameof(title)) }, { PropertyNames.Address, address ?? throw new ArgumentNullException(nameof(address)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (foursquareId is not null) { args.Add(PropertyNames.FoursquareId, foursquareId); } if (foursquareType is not null) { args.Add(PropertyNames.FoursquareType, foursquareType); } if (googlePlaceId is not null) { args.Add(PropertyNames.GooglePlaceId, googlePlaceId); } if (googlePlaceType is not null) { args.Add(PropertyNames.GooglePlaceType, googlePlaceType); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendVenue, args, cancellationToken); } /// /// Use this method to send information about a venue. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Latitude of the venue /// Longitude of the venue /// Name of the venue /// Address of the venue /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Foursquare identifier of the venue /// Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) /// Google Places identifier of the venue /// Google Places type of the venue. (See supported types.) /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVenue( this ITelegramBotClient client, string chatId, float latitude, float longitude, string title, string address, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? foursquareId = null, string? foursquareType = null, string? googlePlaceId = null, string? googlePlaceType = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendVenueAsync( chatId, latitude, longitude, title, address, businessConnectionId, messageThreadId, directMessagesTopicId, foursquareId, foursquareType, googlePlaceId, googlePlaceType, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send information about a venue. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Latitude of the venue /// Longitude of the venue /// Name of the venue /// Address of the venue /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Foursquare identifier of the venue /// Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) /// Google Places identifier of the venue /// Google Places type of the venue. (See supported types.) /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVenueAsync( this ITelegramBotClient client, string chatId, float latitude, float longitude, string title, string address, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? foursquareId = null, string? foursquareType = null, string? googlePlaceId = null, string? googlePlaceType = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Latitude, latitude }, { PropertyNames.Longitude, longitude }, { PropertyNames.Title, title ?? throw new ArgumentNullException(nameof(title)) }, { PropertyNames.Address, address ?? throw new ArgumentNullException(nameof(address)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (foursquareId is not null) { args.Add(PropertyNames.FoursquareId, foursquareId); } if (foursquareType is not null) { args.Add(PropertyNames.FoursquareType, foursquareType); } if (googlePlaceId is not null) { args.Add(PropertyNames.GooglePlaceId, googlePlaceId); } if (googlePlaceType is not null) { args.Add(PropertyNames.GooglePlaceType, googlePlaceType); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendVenue, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendVideo.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as ). On success, the sent is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// The arguments for the "SendVideo" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVideo(this ITelegramBotClient client, SendVideoArgs args) => client.SendVideoAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as ). On success, the sent is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// The arguments for the "SendVideo" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVideoAsync( this ITelegramBotClient client, SendVideoArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendVideo, args, cancellationToken); } /// /// Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as ). On success, the sent is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width /// Video height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// Start timestamp for the video in the message /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Pass True if the uploaded video is suitable for streaming /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVideo( this ITelegramBotClient client, long chatId, InputFile video, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, InputFile? thumbnail = null, InputFile? cover = null, int? startTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? supportsStreaming = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendVideoAsync( chatId, video, businessConnectionId, messageThreadId, directMessagesTopicId, duration, width, height, thumbnail, cover, startTimestamp, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, supportsStreaming, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as ). On success, the sent is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width /// Video height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// Start timestamp for the video in the message /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Pass True if the uploaded video is suitable for streaming /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVideoAsync( this ITelegramBotClient client, long chatId, InputFile video, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, InputFile? thumbnail = null, InputFile? cover = null, int? startTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? supportsStreaming = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Video, video ?? throw new ArgumentNullException(nameof(video)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (width is not null) { args.Add(PropertyNames.Width, width); } if (height is not null) { args.Add(PropertyNames.Height, height); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (cover is not null) { args.Add(PropertyNames.Cover, cover); } if (startTimestamp is not null) { args.Add(PropertyNames.StartTimestamp, startTimestamp); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (supportsStreaming is not null) { args.Add(PropertyNames.SupportsStreaming, supportsStreaming); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendVideo, args, cancellationToken); } /// /// Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as ). On success, the sent is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width /// Video height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// Start timestamp for the video in the message /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Pass True if the uploaded video is suitable for streaming /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVideo( this ITelegramBotClient client, long chatId, string video, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, InputFile? thumbnail = null, string? cover = null, int? startTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? supportsStreaming = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null ) => client .SendVideoAsync( chatId, video, businessConnectionId, messageThreadId, directMessagesTopicId, duration, width, height, thumbnail, cover, startTimestamp, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, supportsStreaming, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup, files ) .GetAwaiter() .GetResult(); /// /// Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as ). On success, the sent is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width /// Video height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// Start timestamp for the video in the message /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Pass True if the uploaded video is suitable for streaming /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVideoAsync( this ITelegramBotClient client, long chatId, string video, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, InputFile? thumbnail = null, string? cover = null, int? startTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? supportsStreaming = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Video, video ?? throw new ArgumentNullException(nameof(video)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (width is not null) { args.Add(PropertyNames.Width, width); } if (height is not null) { args.Add(PropertyNames.Height, height); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (cover is not null) { args.Add(PropertyNames.Cover, cover); } if (startTimestamp is not null) { args.Add(PropertyNames.StartTimestamp, startTimestamp); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (supportsStreaming is not null) { args.Add(PropertyNames.SupportsStreaming, supportsStreaming); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } if (files is not null) { foreach (var file in files) { args.Add(file.Key, file.Value); } } return client.CallMethodAsync(MethodNames.SendVideo, args, cancellationToken); } /// /// Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as ). On success, the sent is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width /// Video height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// Start timestamp for the video in the message /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Pass True if the uploaded video is suitable for streaming /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVideo( this ITelegramBotClient client, string chatId, InputFile video, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, InputFile? thumbnail = null, InputFile? cover = null, int? startTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? supportsStreaming = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendVideoAsync( chatId, video, businessConnectionId, messageThreadId, directMessagesTopicId, duration, width, height, thumbnail, cover, startTimestamp, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, supportsStreaming, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as ). On success, the sent is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width /// Video height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// Start timestamp for the video in the message /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Pass True if the uploaded video is suitable for streaming /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVideoAsync( this ITelegramBotClient client, string chatId, InputFile video, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, InputFile? thumbnail = null, InputFile? cover = null, int? startTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? supportsStreaming = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Video, video ?? throw new ArgumentNullException(nameof(video)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (width is not null) { args.Add(PropertyNames.Width, width); } if (height is not null) { args.Add(PropertyNames.Height, height); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (cover is not null) { args.Add(PropertyNames.Cover, cover); } if (startTimestamp is not null) { args.Add(PropertyNames.StartTimestamp, startTimestamp); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (supportsStreaming is not null) { args.Add(PropertyNames.SupportsStreaming, supportsStreaming); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendVideo, args, cancellationToken); } /// /// Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as ). On success, the sent is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width /// Video height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// Start timestamp for the video in the message /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Pass True if the uploaded video is suitable for streaming /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVideo( this ITelegramBotClient client, string chatId, string video, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, InputFile? thumbnail = null, string? cover = null, int? startTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? supportsStreaming = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null ) => client .SendVideoAsync( chatId, video, businessConnectionId, messageThreadId, directMessagesTopicId, duration, width, height, thumbnail, cover, startTimestamp, caption, parseMode, captionEntities, showCaptionAboveMedia, hasSpoiler, supportsStreaming, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup, files ) .GetAwaiter() .GetResult(); /// /// Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as ). On success, the sent is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width /// Video height /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// Start timestamp for the video in the message /// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing /// Mode for parsing entities in the video caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Pass True, if the caption must be shown above the message media /// Pass True if the video needs to be covered with a spoiler animation /// Pass True if the uploaded video is suitable for streaming /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVideoAsync( this ITelegramBotClient client, string chatId, string video, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? width = null, int? height = null, InputFile? thumbnail = null, string? cover = null, int? startTimestamp = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, bool? showCaptionAboveMedia = null, bool? hasSpoiler = null, bool? supportsStreaming = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Video, video ?? throw new ArgumentNullException(nameof(video)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (width is not null) { args.Add(PropertyNames.Width, width); } if (height is not null) { args.Add(PropertyNames.Height, height); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (cover is not null) { args.Add(PropertyNames.Cover, cover); } if (startTimestamp is not null) { args.Add(PropertyNames.StartTimestamp, startTimestamp); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (showCaptionAboveMedia is not null) { args.Add(PropertyNames.ShowCaptionAboveMedia, showCaptionAboveMedia); } if (hasSpoiler is not null) { args.Add(PropertyNames.HasSpoiler, hasSpoiler); } if (supportsStreaming is not null) { args.Add(PropertyNames.SupportsStreaming, supportsStreaming); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } if (files is not null) { foreach (var file in files) { args.Add(file.Key, file.Value); } } return client.CallMethodAsync(MethodNames.SendVideo, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendVideoNote.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendVideoNote" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVideoNote(this ITelegramBotClient client, SendVideoNoteArgs args) => client.SendVideoNoteAsync(args).GetAwaiter().GetResult(); /// /// As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent is returned. /// /// The instance. /// The arguments for the "SendVideoNote" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVideoNoteAsync( this ITelegramBotClient client, SendVideoNoteArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendVideoNote, args, cancellationToken); } /// /// As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width and height, i.e. diameter of the video message /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVideoNote( this ITelegramBotClient client, long chatId, InputFile videoNote, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? length = null, InputFile? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendVideoNoteAsync( chatId, videoNote, businessConnectionId, messageThreadId, directMessagesTopicId, duration, length, thumbnail, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width and height, i.e. diameter of the video message /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVideoNoteAsync( this ITelegramBotClient client, long chatId, InputFile videoNote, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? length = null, InputFile? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.VideoNote, videoNote ?? throw new ArgumentNullException(nameof(videoNote)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (length is not null) { args.Add(PropertyNames.Length, length); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendVideoNote, args, cancellationToken); } /// /// As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width and height, i.e. diameter of the video message /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVideoNote( this ITelegramBotClient client, long chatId, string videoNote, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? length = null, string? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null ) => client .SendVideoNoteAsync( chatId, videoNote, businessConnectionId, messageThreadId, directMessagesTopicId, duration, length, thumbnail, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup, files ) .GetAwaiter() .GetResult(); /// /// As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width and height, i.e. diameter of the video message /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVideoNoteAsync( this ITelegramBotClient client, long chatId, string videoNote, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? length = null, string? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.VideoNote, videoNote ?? throw new ArgumentNullException(nameof(videoNote)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (length is not null) { args.Add(PropertyNames.Length, length); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } if (files is not null) { foreach (var file in files) { args.Add(file.Key, file.Value); } } return client.CallMethodAsync(MethodNames.SendVideoNote, args, cancellationToken); } /// /// As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width and height, i.e. diameter of the video message /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVideoNote( this ITelegramBotClient client, string chatId, InputFile videoNote, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? length = null, InputFile? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendVideoNoteAsync( chatId, videoNote, businessConnectionId, messageThreadId, directMessagesTopicId, duration, length, thumbnail, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width and height, i.e. diameter of the video message /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVideoNoteAsync( this ITelegramBotClient client, string chatId, InputFile videoNote, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? length = null, InputFile? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.VideoNote, videoNote ?? throw new ArgumentNullException(nameof(videoNote)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (length is not null) { args.Add(PropertyNames.Length, length); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendVideoNote, args, cancellationToken); } /// /// As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width and height, i.e. diameter of the video message /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVideoNote( this ITelegramBotClient client, string chatId, string videoNote, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? length = null, string? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null ) => client .SendVideoNoteAsync( chatId, videoNote, businessConnectionId, messageThreadId, directMessagesTopicId, duration, length, thumbnail, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup, files ) .GetAwaiter() .GetResult(); /// /// As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent is returned. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Duration of sent video in seconds /// Video width and height, i.e. diameter of the video message /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The files to upload. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVideoNoteAsync( this ITelegramBotClient client, string chatId, string videoNote, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, int? duration = null, int? length = null, string? thumbnail = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, IDictionary? files = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.VideoNote, videoNote ?? throw new ArgumentNullException(nameof(videoNote)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (length is not null) { args.Add(PropertyNames.Length, length); } if (thumbnail is not null) { args.Add(PropertyNames.Thumbnail, thumbnail); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } if (files is not null) { foreach (var file in files) { args.Add(file.Key, file.Value); } } return client.CallMethodAsync(MethodNames.SendVideoNote, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/sendVoice.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as or ). On success, the sent is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// The arguments for the "SendVoice" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVoice(this ITelegramBotClient client, SendVoiceArgs args) => client.SendVoiceAsync(args).GetAwaiter().GetResult(); /// /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as or ). On success, the sent is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// The arguments for the "SendVoice" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVoiceAsync( this ITelegramBotClient client, SendVoiceArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SendVoice, args, cancellationToken); } /// /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as or ). On success, the sent is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Voice message caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the voice message caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the voice message in seconds /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVoice( this ITelegramBotClient client, long chatId, InputFile voice, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendVoiceAsync( chatId, voice, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, duration, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as or ). On success, the sent is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Voice message caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the voice message caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the voice message in seconds /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVoiceAsync( this ITelegramBotClient client, long chatId, InputFile voice, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Voice, voice ?? throw new ArgumentNullException(nameof(voice)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendVoice, args, cancellationToken); } /// /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as or ). On success, the sent is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Voice message caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the voice message caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the voice message in seconds /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVoice( this ITelegramBotClient client, long chatId, string voice, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendVoiceAsync( chatId, voice, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, duration, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as or ). On success, the sent is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Voice message caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the voice message caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the voice message in seconds /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVoiceAsync( this ITelegramBotClient client, long chatId, string voice, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Voice, voice ?? throw new ArgumentNullException(nameof(voice)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendVoice, args, cancellationToken); } /// /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as or ). On success, the sent is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Voice message caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the voice message caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the voice message in seconds /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVoice( this ITelegramBotClient client, string chatId, InputFile voice, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendVoiceAsync( chatId, voice, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, duration, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as or ). On success, the sent is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Voice message caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the voice message caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the voice message in seconds /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVoiceAsync( this ITelegramBotClient client, string chatId, InputFile voice, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Voice, voice ?? throw new ArgumentNullException(nameof(voice)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendVoice, args, cancellationToken); } /// /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as or ). On success, the sent is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Voice message caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the voice message caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the voice message in seconds /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Message SendVoice( this ITelegramBotClient client, string chatId, string voice, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null ) => client .SendVoiceAsync( chatId, voice, businessConnectionId, messageThreadId, directMessagesTopicId, caption, parseMode, captionEntities, duration, disableNotification, protectContent, allowPaidBroadcast, messageEffectId, suggestedPostParameters, replyParameters, replyMarkup ) .GetAwaiter() .GetResult(); /// /// Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as or ). On success, the sent is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » /// Unique identifier of the business connection on behalf of which the message will be sent /// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat /// Voice message caption, 0-1024 characters after entities parsing /// Mode for parsing entities in the voice message caption. See formatting options for more details. /// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode /// Duration of the voice message in seconds /// Sends the message silently. Users will receive a notification with no sound. /// Protects the contents of the sent message from forwarding and saving /// Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance. /// Unique identifier of the message effect to be added to the message; for private chats only /// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. /// Description of the message to reply to /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SendVoiceAsync( this ITelegramBotClient client, string chatId, string voice, string? businessConnectionId = null, int? messageThreadId = null, int? directMessagesTopicId = null, string? caption = null, string? parseMode = null, IEnumerable? captionEntities = null, int? duration = null, bool? disableNotification = null, bool? protectContent = null, bool? allowPaidBroadcast = null, string? messageEffectId = null, SuggestedPostParameters? suggestedPostParameters = null, ReplyParameters? replyParameters = null, ReplyMarkup? replyMarkup = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Voice, voice ?? throw new ArgumentNullException(nameof(voice)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageThreadId is not null) { args.Add(PropertyNames.MessageThreadId, messageThreadId); } if (directMessagesTopicId is not null) { args.Add(PropertyNames.DirectMessagesTopicId, directMessagesTopicId); } if (caption is not null) { args.Add(PropertyNames.Caption, caption); } if (parseMode is not null) { args.Add(PropertyNames.ParseMode, parseMode); } if (captionEntities is not null) { args.Add(PropertyNames.CaptionEntities, captionEntities); } if (duration is not null) { args.Add(PropertyNames.Duration, duration); } if (disableNotification is not null) { args.Add(PropertyNames.DisableNotification, disableNotification); } if (protectContent is not null) { args.Add(PropertyNames.ProtectContent, protectContent); } if (allowPaidBroadcast is not null) { args.Add(PropertyNames.AllowPaidBroadcast, allowPaidBroadcast); } if (messageEffectId is not null) { args.Add(PropertyNames.MessageEffectId, messageEffectId); } if (suggestedPostParameters is not null) { args.Add(PropertyNames.SuggestedPostParameters, suggestedPostParameters); } if (replyParameters is not null) { args.Add(PropertyNames.ReplyParameters, replyParameters); } if (replyMarkup is not null) { args.Add(PropertyNames.ReplyMarkup, replyMarkup); } return client.CallMethodAsync(MethodNames.SendVoice, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setBusinessAccountBio.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// The new value of the bio for the business account; 0-140 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetBusinessAccountBio( this ITelegramBotClient client, string businessConnectionId, string? bio = null ) => client.SetBusinessAccountBioAsync(businessConnectionId, bio).GetAwaiter().GetResult(); /// /// Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// The new value of the bio for the business account; 0-140 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetBusinessAccountBioAsync( this ITelegramBotClient client, string businessConnectionId, string? bio = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, }; if (bio is not null) { args.Add(PropertyNames.Bio, bio); } return client.CallMethodAsync( MethodNames.SetBusinessAccountBio, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setBusinessAccountGiftSettings.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success. /// /// The instance. /// The arguments for the "SetBusinessAccountGiftSettings" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetBusinessAccountGiftSettings( this ITelegramBotClient client, SetBusinessAccountGiftSettingsArgs args ) => client.SetBusinessAccountGiftSettingsAsync(args).GetAwaiter().GetResult(); /// /// Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success. /// /// The instance. /// The arguments for the "SetBusinessAccountGiftSettings" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetBusinessAccountGiftSettingsAsync( this ITelegramBotClient client, SetBusinessAccountGiftSettingsArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.SetBusinessAccountGiftSettings, args, cancellationToken ); } /// /// Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field /// Types of gifts accepted by the business account /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetBusinessAccountGiftSettings( this ITelegramBotClient client, string businessConnectionId, bool showGiftButton, AcceptedGiftTypes acceptedGiftTypes ) => client .SetBusinessAccountGiftSettingsAsync( businessConnectionId, showGiftButton, acceptedGiftTypes ) .GetAwaiter() .GetResult(); /// /// Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field /// Types of gifts accepted by the business account /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetBusinessAccountGiftSettingsAsync( this ITelegramBotClient client, string businessConnectionId, bool showGiftButton, AcceptedGiftTypes acceptedGiftTypes, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.ShowGiftButton, showGiftButton }, { PropertyNames.AcceptedGiftTypes, acceptedGiftTypes ?? throw new ArgumentNullException(nameof(acceptedGiftTypes)) }, }; return client.CallMethodAsync( MethodNames.SetBusinessAccountGiftSettings, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setBusinessAccountName.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// The new value of the first name for the business account; 1-64 characters /// The new value of the last name for the business account; 0-64 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetBusinessAccountName( this ITelegramBotClient client, string businessConnectionId, string firstName, string? lastName = null ) => client .SetBusinessAccountNameAsync(businessConnectionId, firstName, lastName) .GetAwaiter() .GetResult(); /// /// Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// The new value of the first name for the business account; 1-64 characters /// The new value of the last name for the business account; 0-64 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetBusinessAccountNameAsync( this ITelegramBotClient client, string businessConnectionId, string firstName, string? lastName = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.FirstName, firstName ?? throw new ArgumentNullException(nameof(firstName)) }, }; if (lastName is not null) { args.Add(PropertyNames.LastName, lastName); } return client.CallMethodAsync( MethodNames.SetBusinessAccountName, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setBusinessAccountProfilePhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success. /// /// The instance. /// The arguments for the "SetBusinessAccountProfilePhoto" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetBusinessAccountProfilePhoto( this ITelegramBotClient client, SetBusinessAccountProfilePhotoArgs args ) => client.SetBusinessAccountProfilePhotoAsync(args).GetAwaiter().GetResult(); /// /// Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success. /// /// The instance. /// The arguments for the "SetBusinessAccountProfilePhoto" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetBusinessAccountProfilePhotoAsync( this ITelegramBotClient client, SetBusinessAccountProfilePhotoArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.SetBusinessAccountProfilePhoto, args, cancellationToken ); } /// /// Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// The new profile photo to set /// Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetBusinessAccountProfilePhoto( this ITelegramBotClient client, string businessConnectionId, InputProfilePhoto photo, bool? isPublic = null ) => client .SetBusinessAccountProfilePhotoAsync(businessConnectionId, photo, isPublic) .GetAwaiter() .GetResult(); /// /// Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// The new profile photo to set /// Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetBusinessAccountProfilePhotoAsync( this ITelegramBotClient client, string businessConnectionId, InputProfilePhoto photo, bool? isPublic = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; if (isPublic is not null) { args.Add(PropertyNames.IsPublic, isPublic); } return client.CallMethodAsync( MethodNames.SetBusinessAccountProfilePhoto, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setBusinessAccountUsername.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// The new value of the username for the business account; 0-32 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetBusinessAccountUsername( this ITelegramBotClient client, string businessConnectionId, string? username = null ) => client .SetBusinessAccountUsernameAsync(businessConnectionId, username) .GetAwaiter() .GetResult(); /// /// Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// The new value of the username for the business account; 0-32 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetBusinessAccountUsernameAsync( this ITelegramBotClient client, string businessConnectionId, string? username = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, }; if (username is not null) { args.Add(PropertyNames.Username, username); } return client.CallMethodAsync( MethodNames.SetBusinessAccountUsername, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setChatAdministratorCustomTitle.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// New custom title for the administrator; 0-16 characters, emoji are not allowed /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatAdministratorCustomTitle( this ITelegramBotClient client, long chatId, long userId, string customTitle ) => client .SetChatAdministratorCustomTitleAsync(chatId, userId, customTitle) .GetAwaiter() .GetResult(); /// /// Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// New custom title for the administrator; 0-16 characters, emoji are not allowed /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatAdministratorCustomTitleAsync( this ITelegramBotClient client, long chatId, long userId, string customTitle, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.UserId, userId }, { PropertyNames.CustomTitle, customTitle ?? throw new ArgumentNullException(nameof(customTitle)) }, }; return client.CallMethodAsync( MethodNames.SetChatAdministratorCustomTitle, args, cancellationToken ); } /// /// Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// New custom title for the administrator; 0-16 characters, emoji are not allowed /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatAdministratorCustomTitle( this ITelegramBotClient client, string chatId, long userId, string customTitle ) => client .SetChatAdministratorCustomTitleAsync(chatId, userId, customTitle) .GetAwaiter() .GetResult(); /// /// Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// New custom title for the administrator; 0-16 characters, emoji are not allowed /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatAdministratorCustomTitleAsync( this ITelegramBotClient client, string chatId, long userId, string customTitle, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.UserId, userId }, { PropertyNames.CustomTitle, customTitle ?? throw new ArgumentNullException(nameof(customTitle)) }, }; return client.CallMethodAsync( MethodNames.SetChatAdministratorCustomTitle, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setChatDescription.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat description, 0-255 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatDescription( this ITelegramBotClient client, long chatId, string? description = null ) => client.SetChatDescriptionAsync(chatId, description).GetAwaiter().GetResult(); /// /// Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat description, 0-255 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatDescriptionAsync( this ITelegramBotClient client, long chatId, string? description = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; if (description is not null) { args.Add(PropertyNames.Description, description); } return client.CallMethodAsync( MethodNames.SetChatDescription, args, cancellationToken ); } /// /// Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat description, 0-255 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatDescription( this ITelegramBotClient client, string chatId, string? description = null ) => client.SetChatDescriptionAsync(chatId, description).GetAwaiter().GetResult(); /// /// Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat description, 0-255 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatDescriptionAsync( this ITelegramBotClient client, string chatId, string? description = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; if (description is not null) { args.Add(PropertyNames.Description, description); } return client.CallMethodAsync( MethodNames.SetChatDescription, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setChatMemberTag.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// New tag for the member; 0-16 characters, emoji are not allowed /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatMemberTag( this ITelegramBotClient client, long chatId, long userId, string? tag = null ) => client.SetChatMemberTagAsync(chatId, userId, tag).GetAwaiter().GetResult(); /// /// Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// New tag for the member; 0-16 characters, emoji are not allowed /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatMemberTagAsync( this ITelegramBotClient client, long chatId, long userId, string? tag = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.UserId, userId }, }; if (tag is not null) { args.Add(PropertyNames.Tag, tag); } return client.CallMethodAsync(MethodNames.SetChatMemberTag, args, cancellationToken); } /// /// Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// New tag for the member; 0-16 characters, emoji are not allowed /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatMemberTag( this ITelegramBotClient client, string chatId, long userId, string? tag = null ) => client.SetChatMemberTagAsync(chatId, userId, tag).GetAwaiter().GetResult(); /// /// Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier of the target user /// New tag for the member; 0-16 characters, emoji are not allowed /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatMemberTagAsync( this ITelegramBotClient client, string chatId, long userId, string? tag = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.UserId, userId }, }; if (tag is not null) { args.Add(PropertyNames.Tag, tag); } return client.CallMethodAsync(MethodNames.SetChatMemberTag, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setChatMenuButton.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. /// /// The instance. /// The arguments for the "SetChatMenuButton" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatMenuButton( this ITelegramBotClient client, SetChatMenuButtonArgs args ) => client.SetChatMenuButtonAsync(args).GetAwaiter().GetResult(); /// /// Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. /// /// The instance. /// The arguments for the "SetChatMenuButton" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatMenuButtonAsync( this ITelegramBotClient client, SetChatMenuButtonArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SetChatMenuButton, args, cancellationToken); } /// /// Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. /// /// The instance. /// Unique identifier for the target private chat. If not specified, default bot's menu button will be changed /// A JSON-serialized object for the bot's new menu button. Defaults to /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatMenuButton( this ITelegramBotClient client, long? chatId = null, MenuButton? menuButton = null ) => client.SetChatMenuButtonAsync(chatId, menuButton).GetAwaiter().GetResult(); /// /// Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. /// /// The instance. /// Unique identifier for the target private chat. If not specified, default bot's menu button will be changed /// A JSON-serialized object for the bot's new menu button. Defaults to /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatMenuButtonAsync( this ITelegramBotClient client, long? chatId = null, MenuButton? menuButton = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { }; if (chatId is not null) { args.Add(PropertyNames.ChatId, chatId); } if (menuButton is not null) { args.Add(PropertyNames.MenuButton, menuButton); } return client.CallMethodAsync(MethodNames.SetChatMenuButton, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setChatPermissions.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success. /// /// The instance. /// The arguments for the "SetChatPermissions" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatPermissions( this ITelegramBotClient client, SetChatPermissionsArgs args ) => client.SetChatPermissionsAsync(args).GetAwaiter().GetResult(); /// /// Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success. /// /// The instance. /// The arguments for the "SetChatPermissions" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatPermissionsAsync( this ITelegramBotClient client, SetChatPermissionsArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.SetChatPermissions, args, cancellationToken ); } /// /// Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// A JSON-serialized object for new default chat permissions /// Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatPermissions( this ITelegramBotClient client, long chatId, ChatPermissions permissions, bool? useIndependentChatPermissions = null ) => client .SetChatPermissionsAsync(chatId, permissions, useIndependentChatPermissions) .GetAwaiter() .GetResult(); /// /// Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// A JSON-serialized object for new default chat permissions /// Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatPermissionsAsync( this ITelegramBotClient client, long chatId, ChatPermissions permissions, bool? useIndependentChatPermissions = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Permissions, permissions ?? throw new ArgumentNullException(nameof(permissions)) }, }; if (useIndependentChatPermissions is not null) { args.Add(PropertyNames.UseIndependentChatPermissions, useIndependentChatPermissions); } return client.CallMethodAsync( MethodNames.SetChatPermissions, args, cancellationToken ); } /// /// Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// A JSON-serialized object for new default chat permissions /// Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatPermissions( this ITelegramBotClient client, string chatId, ChatPermissions permissions, bool? useIndependentChatPermissions = null ) => client .SetChatPermissionsAsync(chatId, permissions, useIndependentChatPermissions) .GetAwaiter() .GetResult(); /// /// Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// A JSON-serialized object for new default chat permissions /// Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatPermissionsAsync( this ITelegramBotClient client, string chatId, ChatPermissions permissions, bool? useIndependentChatPermissions = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Permissions, permissions ?? throw new ArgumentNullException(nameof(permissions)) }, }; if (useIndependentChatPermissions is not null) { args.Add(PropertyNames.UseIndependentChatPermissions, useIndependentChatPermissions); } return client.CallMethodAsync( MethodNames.SetChatPermissions, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setChatPhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// The arguments for the "SetChatPhoto" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatPhoto(this ITelegramBotClient client, SetChatPhotoArgs args) => client.SetChatPhotoAsync(args).GetAwaiter().GetResult(); /// /// Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// The arguments for the "SetChatPhoto" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatPhotoAsync( this ITelegramBotClient client, SetChatPhotoArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SetChatPhoto, args, cancellationToken); } /// /// Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat photo, uploaded using multipart/form-data /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatPhoto(this ITelegramBotClient client, long chatId, InputFile photo) => client.SetChatPhotoAsync(chatId, photo).GetAwaiter().GetResult(); /// /// Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat photo, uploaded using multipart/form-data /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatPhotoAsync( this ITelegramBotClient client, long chatId, InputFile photo, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; return client.CallMethodAsync(MethodNames.SetChatPhoto, args, cancellationToken); } /// /// Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat photo, uploaded using multipart/form-data /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatPhoto( this ITelegramBotClient client, string chatId, InputFile photo ) => client.SetChatPhotoAsync(chatId, photo).GetAwaiter().GetResult(); /// /// Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat photo, uploaded using multipart/form-data /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatPhotoAsync( this ITelegramBotClient client, string chatId, InputFile photo, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; return client.CallMethodAsync(MethodNames.SetChatPhoto, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setChatStickerSet.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Name of the sticker set to be set as the group sticker set /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatStickerSet( this ITelegramBotClient client, long chatId, string stickerSetName ) => client.SetChatStickerSetAsync(chatId, stickerSetName).GetAwaiter().GetResult(); /// /// Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Name of the sticker set to be set as the group sticker set /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatStickerSetAsync( this ITelegramBotClient client, long chatId, string stickerSetName, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.StickerSetName, stickerSetName ?? throw new ArgumentNullException(nameof(stickerSetName)) }, }; return client.CallMethodAsync(MethodNames.SetChatStickerSet, args, cancellationToken); } /// /// Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Name of the sticker set to be set as the group sticker set /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatStickerSet( this ITelegramBotClient client, string chatId, string stickerSetName ) => client.SetChatStickerSetAsync(chatId, stickerSetName).GetAwaiter().GetResult(); /// /// Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Name of the sticker set to be set as the group sticker set /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatStickerSetAsync( this ITelegramBotClient client, string chatId, string stickerSetName, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.StickerSetName, stickerSetName ?? throw new ArgumentNullException(nameof(stickerSetName)) }, }; return client.CallMethodAsync(MethodNames.SetChatStickerSet, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setChatTitle.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat title, 1-128 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatTitle(this ITelegramBotClient client, long chatId, string title) => client.SetChatTitleAsync(chatId, title).GetAwaiter().GetResult(); /// /// Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat title, 1-128 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatTitleAsync( this ITelegramBotClient client, long chatId, string title, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.Title, title ?? throw new ArgumentNullException(nameof(title)) }, }; return client.CallMethodAsync(MethodNames.SetChatTitle, args, cancellationToken); } /// /// Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat title, 1-128 characters /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetChatTitle(this ITelegramBotClient client, string chatId, string title) => client.SetChatTitleAsync(chatId, title).GetAwaiter().GetResult(); /// /// Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// New chat title, 1-128 characters /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetChatTitleAsync( this ITelegramBotClient client, string chatId, string title, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.Title, title ?? throw new ArgumentNullException(nameof(title)) }, }; return client.CallMethodAsync(MethodNames.SetChatTitle, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setManagedBotAccessSettings.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to change the access settings of a managed bot. Returns True on success. /// /// The instance. /// The arguments for the "SetManagedBotAccessSettings" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetManagedBotAccessSettings( this ITelegramBotClient client, SetManagedBotAccessSettingsArgs args ) => client.SetManagedBotAccessSettingsAsync(args).GetAwaiter().GetResult(); /// /// Use this method to change the access settings of a managed bot. Returns True on success. /// /// The instance. /// The arguments for the "SetManagedBotAccessSettings" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetManagedBotAccessSettingsAsync( this ITelegramBotClient client, SetManagedBotAccessSettingsArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.SetManagedBotAccessSettings, args, cancellationToken ); } /// /// Use this method to change the access settings of a managed bot. Returns True on success. /// /// The instance. /// User identifier of the managed bot whose access settings will be changed /// Pass True, if only selected users can access the bot. The bot's owner can always access it. /// A JSON-serialized list of up to 10 identifiers of users who will have access to the bot in addition to its owner. Ignored if is_access_restricted is false. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetManagedBotAccessSettings( this ITelegramBotClient client, long userId, bool isAccessRestricted, IEnumerable? addedUserIds = null ) => client .SetManagedBotAccessSettingsAsync(userId, isAccessRestricted, addedUserIds) .GetAwaiter() .GetResult(); /// /// Use this method to change the access settings of a managed bot. Returns True on success. /// /// The instance. /// User identifier of the managed bot whose access settings will be changed /// Pass True, if only selected users can access the bot. The bot's owner can always access it. /// A JSON-serialized list of up to 10 identifiers of users who will have access to the bot in addition to its owner. Ignored if is_access_restricted is false. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetManagedBotAccessSettingsAsync( this ITelegramBotClient client, long userId, bool isAccessRestricted, IEnumerable? addedUserIds = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId }, { PropertyNames.IsAccessRestricted, isAccessRestricted }, }; if (addedUserIds is not null) { args.Add(PropertyNames.AddedUserIds, addedUserIds); } return client.CallMethodAsync( MethodNames.SetManagedBotAccessSettings, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setMessageReaction.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success. /// /// The instance. /// The arguments for the "SetMessageReaction" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetMessageReaction( this ITelegramBotClient client, SetMessageReactionArgs args ) => client.SetMessageReactionAsync(args).GetAwaiter().GetResult(); /// /// Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success. /// /// The instance. /// The arguments for the "SetMessageReaction" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetMessageReactionAsync( this ITelegramBotClient client, SetMessageReactionArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.SetMessageReaction, args, cancellationToken ); } /// /// Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead. /// A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots. /// Pass True to set the reaction with a big animation /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetMessageReaction( this ITelegramBotClient client, long chatId, int messageId, IEnumerable? reaction = null, bool? isBig = null ) => client.SetMessageReactionAsync(chatId, messageId, reaction, isBig).GetAwaiter().GetResult(); /// /// Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead. /// A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots. /// Pass True to set the reaction with a big animation /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetMessageReactionAsync( this ITelegramBotClient client, long chatId, int messageId, IEnumerable? reaction = null, bool? isBig = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.MessageId, messageId }, }; if (reaction is not null) { args.Add(PropertyNames.Reaction, reaction); } if (isBig is not null) { args.Add(PropertyNames.IsBig, isBig); } return client.CallMethodAsync( MethodNames.SetMessageReaction, args, cancellationToken ); } /// /// Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead. /// A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots. /// Pass True to set the reaction with a big animation /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetMessageReaction( this ITelegramBotClient client, string chatId, int messageId, IEnumerable? reaction = null, bool? isBig = null ) => client.SetMessageReactionAsync(chatId, messageId, reaction, isBig).GetAwaiter().GetResult(); /// /// Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username /// Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead. /// A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots. /// Pass True to set the reaction with a big animation /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetMessageReactionAsync( this ITelegramBotClient client, string chatId, int messageId, IEnumerable? reaction = null, bool? isBig = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.MessageId, messageId }, }; if (reaction is not null) { args.Add(PropertyNames.Reaction, reaction); } if (isBig is not null) { args.Add(PropertyNames.IsBig, isBig); } return client.CallMethodAsync( MethodNames.SetMessageReaction, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setMyCommands.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success. /// /// The instance. /// The arguments for the "SetMyCommands" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetMyCommands(this ITelegramBotClient client, SetMyCommandsArgs args) => client.SetMyCommandsAsync(args).GetAwaiter().GetResult(); /// /// Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success. /// /// The instance. /// The arguments for the "SetMyCommands" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetMyCommandsAsync( this ITelegramBotClient client, SetMyCommandsArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SetMyCommands, args, cancellationToken); } /// /// Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success. /// /// The instance. /// A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. /// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to . /// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetMyCommands( this ITelegramBotClient client, IEnumerable commands, BotCommandScope? scope = null, string? languageCode = null ) => client.SetMyCommandsAsync(commands, scope, languageCode).GetAwaiter().GetResult(); /// /// Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success. /// /// The instance. /// A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. /// A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to . /// A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetMyCommandsAsync( this ITelegramBotClient client, IEnumerable commands, BotCommandScope? scope = null, string? languageCode = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.Commands, commands ?? throw new ArgumentNullException(nameof(commands)) }, }; if (scope is not null) { args.Add(PropertyNames.Scope, scope); } if (languageCode is not null) { args.Add(PropertyNames.LanguageCode, languageCode); } return client.CallMethodAsync(MethodNames.SetMyCommands, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setMyDefaultAdministratorRights.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns True on success. /// /// The instance. /// The arguments for the "SetMyDefaultAdministratorRights" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetMyDefaultAdministratorRights( this ITelegramBotClient client, SetMyDefaultAdministratorRightsArgs args ) => client.SetMyDefaultAdministratorRightsAsync(args).GetAwaiter().GetResult(); /// /// Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns True on success. /// /// The instance. /// The arguments for the "SetMyDefaultAdministratorRights" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetMyDefaultAdministratorRightsAsync( this ITelegramBotClient client, SetMyDefaultAdministratorRightsArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync( MethodNames.SetMyDefaultAdministratorRights, args, cancellationToken ); } /// /// Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns True on success. /// /// The instance. /// A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared. /// Pass True to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetMyDefaultAdministratorRights( this ITelegramBotClient client, ChatAdministratorRights? rights = null, bool? forChannels = null ) => client.SetMyDefaultAdministratorRightsAsync(rights, forChannels).GetAwaiter().GetResult(); /// /// Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns True on success. /// /// The instance. /// A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared. /// Pass True to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetMyDefaultAdministratorRightsAsync( this ITelegramBotClient client, ChatAdministratorRights? rights = null, bool? forChannels = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { }; if (rights is not null) { args.Add(PropertyNames.Rights, rights); } if (forChannels is not null) { args.Add(PropertyNames.ForChannels, forChannels); } return client.CallMethodAsync( MethodNames.SetMyDefaultAdministratorRights, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setMyDescription.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success. /// /// The instance. /// New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language. /// A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetMyDescription( this ITelegramBotClient client, string? description = null, string? languageCode = null ) => client.SetMyDescriptionAsync(description, languageCode).GetAwaiter().GetResult(); /// /// Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success. /// /// The instance. /// New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language. /// A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetMyDescriptionAsync( this ITelegramBotClient client, string? description = null, string? languageCode = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { }; if (description is not null) { args.Add(PropertyNames.Description, description); } if (languageCode is not null) { args.Add(PropertyNames.LanguageCode, languageCode); } return client.CallMethodAsync(MethodNames.SetMyDescription, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setMyName.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to change the bot's name. Returns True on success. /// /// The instance. /// New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. /// A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetMyName( this ITelegramBotClient client, string? name = null, string? languageCode = null ) => client.SetMyNameAsync(name, languageCode).GetAwaiter().GetResult(); /// /// Use this method to change the bot's name. Returns True on success. /// /// The instance. /// New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. /// A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetMyNameAsync( this ITelegramBotClient client, string? name = null, string? languageCode = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { }; if (name is not null) { args.Add(PropertyNames.Name, name); } if (languageCode is not null) { args.Add(PropertyNames.LanguageCode, languageCode); } return client.CallMethodAsync(MethodNames.SetMyName, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setMyProfilePhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.AvailableTypes; namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Changes the profile photo of the bot. Returns True on success. /// /// The instance. /// The arguments for the "SetMyProfilePhoto" method. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetMyProfilePhoto( this ITelegramBotClient client, SetMyProfilePhotoArgs args ) => client.SetMyProfilePhotoAsync(args).GetAwaiter().GetResult(); /// /// Changes the profile photo of the bot. Returns True on success. /// /// The instance. /// The arguments for the "SetMyProfilePhoto" method. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetMyProfilePhotoAsync( this ITelegramBotClient client, SetMyProfilePhotoArgs args, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } return client.CallMethodAsync(MethodNames.SetMyProfilePhoto, args, cancellationToken); } /// /// Changes the profile photo of the bot. Returns True on success. /// /// The instance. /// The new profile photo to set /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetMyProfilePhoto(this ITelegramBotClient client, InputProfilePhoto photo) => client.SetMyProfilePhotoAsync(photo).GetAwaiter().GetResult(); /// /// Changes the profile photo of the bot. Returns True on success. /// /// The instance. /// The new profile photo to set /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetMyProfilePhotoAsync( this ITelegramBotClient client, InputProfilePhoto photo, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.Photo, photo ?? throw new ArgumentNullException(nameof(photo)) }, }; return client.CallMethodAsync(MethodNames.SetMyProfilePhoto, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setMyShortDescription.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns True on success. /// /// The instance. /// New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language. /// A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetMyShortDescription( this ITelegramBotClient client, string? shortDescription = null, string? languageCode = null ) => client.SetMyShortDescriptionAsync(shortDescription, languageCode).GetAwaiter().GetResult(); /// /// Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns True on success. /// /// The instance. /// New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language. /// A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetMyShortDescriptionAsync( this ITelegramBotClient client, string? shortDescription = null, string? languageCode = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { }; if (shortDescription is not null) { args.Add(PropertyNames.ShortDescription, shortDescription); } if (languageCode is not null) { args.Add(PropertyNames.LanguageCode, languageCode); } return client.CallMethodAsync( MethodNames.SetMyShortDescription, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/setUserEmojiStatus.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success. /// /// The instance. /// Unique identifier of the target user /// Custom emoji identifier of the emoji status to set. Pass an empty string to remove the status. /// Expiration date of the emoji status, if any /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool SetUserEmojiStatus( this ITelegramBotClient client, long userId, string? emojiStatusCustomEmojiId = null, int? emojiStatusExpirationDate = null ) => client .SetUserEmojiStatusAsync(userId, emojiStatusCustomEmojiId, emojiStatusExpirationDate) .GetAwaiter() .GetResult(); /// /// Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success. /// /// The instance. /// Unique identifier of the target user /// Custom emoji identifier of the emoji status to set. Pass an empty string to remove the status. /// Expiration date of the emoji status, if any /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task SetUserEmojiStatusAsync( this ITelegramBotClient client, long userId, string? emojiStatusCustomEmojiId = null, int? emojiStatusExpirationDate = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId } }; if (emojiStatusCustomEmojiId is not null) { args.Add(PropertyNames.EmojiStatusCustomEmojiId, emojiStatusCustomEmojiId); } if (emojiStatusExpirationDate is not null) { args.Add(PropertyNames.EmojiStatusExpirationDate, emojiStatusExpirationDate); } return client.CallMethodAsync( MethodNames.SetUserEmojiStatus, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/transferBusinessAccountStars.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Number of Telegram Stars to transfer; 1-10000 /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool TransferBusinessAccountStars( this ITelegramBotClient client, string businessConnectionId, int starCount ) => client .TransferBusinessAccountStarsAsync(businessConnectionId, starCount) .GetAwaiter() .GetResult(); /// /// Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Number of Telegram Stars to transfer; 1-10000 /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task TransferBusinessAccountStarsAsync( this ITelegramBotClient client, string businessConnectionId, int starCount, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.StarCount, starCount }, }; return client.CallMethodAsync( MethodNames.TransferBusinessAccountStars, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/transferGift.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Unique identifier of the regular gift that should be transferred /// Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours. /// The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool TransferGift( this ITelegramBotClient client, string businessConnectionId, string ownedGiftId, long newOwnerChatId, int? starCount = null ) => client .TransferGiftAsync(businessConnectionId, ownedGiftId, newOwnerChatId, starCount) .GetAwaiter() .GetResult(); /// /// Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Unique identifier of the regular gift that should be transferred /// Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours. /// The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task TransferGiftAsync( this ITelegramBotClient client, string businessConnectionId, string ownedGiftId, long newOwnerChatId, int? starCount = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.OwnedGiftId, ownedGiftId ?? throw new ArgumentNullException(nameof(ownedGiftId)) }, { PropertyNames.NewOwnerChatId, newOwnerChatId }, }; if (starCount is not null) { args.Add(PropertyNames.StarCount, starCount); } return client.CallMethodAsync(MethodNames.TransferGift, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/unbanChatMember.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success. /// /// The instance. /// Unique identifier for the target group or username of the target supergroup or channel in the format @username /// Unique identifier of the target user /// Do nothing if the user is not banned /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnbanChatMember( this ITelegramBotClient client, long chatId, long userId, bool? onlyIfBanned = null ) => client.UnbanChatMemberAsync(chatId, userId, onlyIfBanned).GetAwaiter().GetResult(); /// /// Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success. /// /// The instance. /// Unique identifier for the target group or username of the target supergroup or channel in the format @username /// Unique identifier of the target user /// Do nothing if the user is not banned /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnbanChatMemberAsync( this ITelegramBotClient client, long chatId, long userId, bool? onlyIfBanned = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.UserId, userId }, }; if (onlyIfBanned is not null) { args.Add(PropertyNames.OnlyIfBanned, onlyIfBanned); } return client.CallMethodAsync(MethodNames.UnbanChatMember, args, cancellationToken); } /// /// Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success. /// /// The instance. /// Unique identifier for the target group or username of the target supergroup or channel in the format @username /// Unique identifier of the target user /// Do nothing if the user is not banned /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnbanChatMember( this ITelegramBotClient client, string chatId, long userId, bool? onlyIfBanned = null ) => client.UnbanChatMemberAsync(chatId, userId, onlyIfBanned).GetAwaiter().GetResult(); /// /// Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success. /// /// The instance. /// Unique identifier for the target group or username of the target supergroup or channel in the format @username /// Unique identifier of the target user /// Do nothing if the user is not banned /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnbanChatMemberAsync( this ITelegramBotClient client, string chatId, long userId, bool? onlyIfBanned = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.UserId, userId }, }; if (onlyIfBanned is not null) { args.Add(PropertyNames.OnlyIfBanned, onlyIfBanned); } return client.CallMethodAsync(MethodNames.UnbanChatMember, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/unbanChatSenderChat.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target sender chat /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnbanChatSenderChat( this ITelegramBotClient client, long chatId, long senderChatId ) => client.UnbanChatSenderChatAsync(chatId, senderChatId).GetAwaiter().GetResult(); /// /// Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target sender chat /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnbanChatSenderChatAsync( this ITelegramBotClient client, long chatId, long senderChatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.SenderChatId, senderChatId }, }; return client.CallMethodAsync( MethodNames.UnbanChatSenderChat, args, cancellationToken ); } /// /// Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target sender chat /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnbanChatSenderChat( this ITelegramBotClient client, string chatId, long senderChatId ) => client.UnbanChatSenderChatAsync(chatId, senderChatId).GetAwaiter().GetResult(); /// /// Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the target sender chat /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnbanChatSenderChatAsync( this ITelegramBotClient client, string chatId, long senderChatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.SenderChatId, senderChatId }, }; return client.CallMethodAsync( MethodNames.UnbanChatSenderChat, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/unhideGeneralForumTopic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnhideGeneralForumTopic(this ITelegramBotClient client, long chatId) => client.UnhideGeneralForumTopicAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnhideGeneralForumTopicAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync( MethodNames.UnhideGeneralForumTopic, args, cancellationToken ); } /// /// Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnhideGeneralForumTopic(this ITelegramBotClient client, string chatId) => client.UnhideGeneralForumTopicAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnhideGeneralForumTopicAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync( MethodNames.UnhideGeneralForumTopic, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/unpinAllChatMessages.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnpinAllChatMessages(this ITelegramBotClient client, long chatId) => client.UnpinAllChatMessagesAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnpinAllChatMessagesAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync( MethodNames.UnpinAllChatMessages, args, cancellationToken ); } /// /// Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnpinAllChatMessages(this ITelegramBotClient client, string chatId) => client.UnpinAllChatMessagesAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnpinAllChatMessagesAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync( MethodNames.UnpinAllChatMessages, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/unpinAllForumTopicMessages.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnpinAllForumTopicMessages( this ITelegramBotClient client, long chatId, int messageThreadId ) => client.UnpinAllForumTopicMessagesAsync(chatId, messageThreadId).GetAwaiter().GetResult(); /// /// Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnpinAllForumTopicMessagesAsync( this ITelegramBotClient client, long chatId, int messageThreadId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId }, { PropertyNames.MessageThreadId, messageThreadId }, }; return client.CallMethodAsync( MethodNames.UnpinAllForumTopicMessages, args, cancellationToken ); } /// /// Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnpinAllForumTopicMessages( this ITelegramBotClient client, string chatId, int messageThreadId ) => client.UnpinAllForumTopicMessagesAsync(chatId, messageThreadId).GetAwaiter().GetResult(); /// /// Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Unique identifier for the target message thread of the forum topic /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnpinAllForumTopicMessagesAsync( this ITelegramBotClient client, string chatId, int messageThreadId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, { PropertyNames.MessageThreadId, messageThreadId }, }; return client.CallMethodAsync( MethodNames.UnpinAllForumTopicMessages, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/unpinAllGeneralForumTopicMessages.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnpinAllGeneralForumTopicMessages( this ITelegramBotClient client, long chatId ) => client.UnpinAllGeneralForumTopicMessagesAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnpinAllGeneralForumTopicMessagesAsync( this ITelegramBotClient client, long chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; return client.CallMethodAsync( MethodNames.UnpinAllGeneralForumTopicMessages, args, cancellationToken ); } /// /// Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnpinAllGeneralForumTopicMessages( this ITelegramBotClient client, string chatId ) => client.UnpinAllGeneralForumTopicMessagesAsync(chatId).GetAwaiter().GetResult(); /// /// Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target supergroup in the format @username /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnpinAllGeneralForumTopicMessagesAsync( this ITelegramBotClient client, string chatId, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; return client.CallMethodAsync( MethodNames.UnpinAllGeneralForumTopicMessages, args, cancellationToken ); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/unpinChatMessage.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Use this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the business connection on behalf of which the message will be unpinned /// Identifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be unpinned. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnpinChatMessage( this ITelegramBotClient client, long chatId, string? businessConnectionId = null, int? messageId = null ) => client .UnpinChatMessageAsync(chatId, businessConnectionId, messageId) .GetAwaiter() .GetResult(); /// /// Use this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the business connection on behalf of which the message will be unpinned /// Identifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be unpinned. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnpinChatMessageAsync( this ITelegramBotClient client, long chatId, string? businessConnectionId = null, int? messageId = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageId is not null) { args.Add(PropertyNames.MessageId, messageId); } return client.CallMethodAsync(MethodNames.UnpinChatMessage, args, cancellationToken); } /// /// Use this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the business connection on behalf of which the message will be unpinned /// Identifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be unpinned. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UnpinChatMessage( this ITelegramBotClient client, string chatId, string? businessConnectionId = null, int? messageId = null ) => client .UnpinChatMessageAsync(chatId, businessConnectionId, messageId) .GetAwaiter() .GetResult(); /// /// Use this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target channel in the format @username /// Unique identifier of the business connection on behalf of which the message will be unpinned /// Identifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be unpinned. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UnpinChatMessageAsync( this ITelegramBotClient client, string chatId, string? businessConnectionId = null, int? messageId = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; if (businessConnectionId is not null) { args.Add(PropertyNames.BusinessConnectionId, businessConnectionId); } if (messageId is not null) { args.Add(PropertyNames.MessageId, messageId); } return client.CallMethodAsync(MethodNames.UnpinChatMessage, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/upgradeGift.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Unique identifier of the regular gift that should be upgraded to a unique one /// Pass True to keep the original gift text, sender and receiver in the upgraded gift /// The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool UpgradeGift( this ITelegramBotClient client, string businessConnectionId, string ownedGiftId, bool? keepOriginalDetails = null, int? starCount = null ) => client .UpgradeGiftAsync(businessConnectionId, ownedGiftId, keepOriginalDetails, starCount) .GetAwaiter() .GetResult(); /// /// Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success. /// /// The instance. /// Unique identifier of the business connection /// Unique identifier of the regular gift that should be upgraded to a unique one /// Pass True to keep the original gift text, sender and receiver in the upgraded gift /// The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task UpgradeGiftAsync( this ITelegramBotClient client, string businessConnectionId, string ownedGiftId, bool? keepOriginalDetails = null, int? starCount = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.BusinessConnectionId, businessConnectionId ?? throw new ArgumentNullException(nameof(businessConnectionId)) }, { PropertyNames.OwnedGiftId, ownedGiftId ?? throw new ArgumentNullException(nameof(ownedGiftId)) }, }; if (keepOriginalDetails is not null) { args.Add(PropertyNames.KeepOriginalDetails, keepOriginalDetails); } if (starCount is not null) { args.Add(PropertyNames.StarCount, starCount); } return client.CallMethodAsync(MethodNames.UpgradeGift, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/verifyChat.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel direct messages chats can't be verified. /// Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool VerifyChat( this ITelegramBotClient client, long chatId, string? customDescription = null ) => client.VerifyChatAsync(chatId, customDescription).GetAwaiter().GetResult(); /// /// Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel direct messages chats can't be verified. /// Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task VerifyChatAsync( this ITelegramBotClient client, long chatId, string? customDescription = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId } }; if (customDescription is not null) { args.Add(PropertyNames.CustomDescription, customDescription); } return client.CallMethodAsync(MethodNames.VerifyChat, args, cancellationToken); } /// /// Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel direct messages chats can't be verified. /// Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool VerifyChat( this ITelegramBotClient client, string chatId, string? customDescription = null ) => client.VerifyChatAsync(chatId, customDescription).GetAwaiter().GetResult(); /// /// Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success. /// /// The instance. /// Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Channel direct messages chats can't be verified. /// Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task VerifyChatAsync( this ITelegramBotClient client, string chatId, string? customDescription = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.ChatId, chatId ?? throw new ArgumentNullException(nameof(chatId)) }, }; if (customDescription is not null) { args.Add(PropertyNames.CustomDescription, customDescription); } return client.CallMethodAsync(MethodNames.VerifyChat, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableMethods/verifyUser.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableMethods; /// /// Extension methods for the Telegram Bot API. /// public static partial class AvailableMethodsExtensions { /// /// Verifies a user on behalf of the organization which is represented by the bot. Returns True on success. /// /// The instance. /// Unique identifier of the target user /// Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static bool VerifyUser( this ITelegramBotClient client, long userId, string? customDescription = null ) => client.VerifyUserAsync(userId, customDescription).GetAwaiter().GetResult(); /// /// Verifies a user on behalf of the organization which is represented by the bot. Returns True on success. /// /// The instance. /// Unique identifier of the target user /// Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. /// The cancellation token to cancel operation. /// Thrown if is null. /// Thrown if the request to the Telegram Bot API fails. /// public static Task VerifyUserAsync( this ITelegramBotClient client, long userId, string? customDescription = null, CancellationToken cancellationToken = default ) { if (client is null) { throw new ArgumentNullException(nameof(client)); } var args = new Dictionary() { { PropertyNames.UserId, userId } }; if (customDescription is not null) { args.Add(PropertyNames.CustomDescription, customDescription); } return client.CallMethodAsync(MethodNames.VerifyUser, args, cancellationToken); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/AcceptedGiftTypes.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the types of gifts that can be gifted to a user or a chat. /// public class AcceptedGiftTypes { /// /// True, if unlimited regular gifts are accepted /// [JsonPropertyName(PropertyNames.UnlimitedGifts)] public bool UnlimitedGifts { get; set; } /// /// True, if limited regular gifts are accepted /// [JsonPropertyName(PropertyNames.LimitedGifts)] public bool LimitedGifts { get; set; } /// /// True, if unique gifts or gifts that can be upgraded to unique for free are accepted /// [JsonPropertyName(PropertyNames.UniqueGifts)] public bool UniqueGifts { get; set; } /// /// True, if a Telegram Premium subscription is accepted /// [JsonPropertyName(PropertyNames.PremiumSubscription)] public bool PremiumSubscription { get; set; } /// /// True, if transfers of unique gifts from channels are accepted /// [JsonPropertyName(PropertyNames.GiftsFromChannels)] public bool GiftsFromChannels { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Animation.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). /// public class Animation { /// /// Identifier for this file, which can be used to download or reuse the file /// [JsonPropertyName(PropertyNames.FileId)] public string FileId { get; set; } = null!; /// /// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. /// [JsonPropertyName(PropertyNames.FileUniqueId)] public string FileUniqueId { get; set; } = null!; /// /// Video width as defined by the sender /// [JsonPropertyName(PropertyNames.Width)] public int Width { get; set; } /// /// Video height as defined by the sender /// [JsonPropertyName(PropertyNames.Height)] public int Height { get; set; } /// /// Duration of the video in seconds as defined by the sender /// [JsonPropertyName(PropertyNames.Duration)] public int Duration { get; set; } /// /// Optional. Animation thumbnail as defined by the sender /// [JsonPropertyName(PropertyNames.Thumbnail)] public PhotoSize? Thumbnail { get; set; } /// /// Optional. Original animation filename as defined by the sender /// [JsonPropertyName(PropertyNames.FileName)] public string? FileName { get; set; } /// /// Optional. MIME type of the file as defined by the sender /// [JsonPropertyName(PropertyNames.MimeType)] public string? MimeType { get; set; } /// /// Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. /// [JsonPropertyName(PropertyNames.FileSize)] public long? FileSize { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Audio.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents an audio file to be treated as music by the Telegram clients. /// public class Audio { /// /// Identifier for this file, which can be used to download or reuse the file /// [JsonPropertyName(PropertyNames.FileId)] public string FileId { get; set; } = null!; /// /// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. /// [JsonPropertyName(PropertyNames.FileUniqueId)] public string FileUniqueId { get; set; } = null!; /// /// Duration of the audio in seconds as defined by the sender /// [JsonPropertyName(PropertyNames.Duration)] public int Duration { get; set; } /// /// Optional. Performer of the audio as defined by the sender or by audio tags /// [JsonPropertyName(PropertyNames.Performer)] public string? Performer { get; set; } /// /// Optional. Title of the audio as defined by the sender or by audio tags /// [JsonPropertyName(PropertyNames.Title)] public string? Title { get; set; } /// /// Optional. Original filename as defined by the sender /// [JsonPropertyName(PropertyNames.FileName)] public string? FileName { get; set; } /// /// Optional. MIME type of the file as defined by the sender /// [JsonPropertyName(PropertyNames.MimeType)] public string? MimeType { get; set; } /// /// Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. /// [JsonPropertyName(PropertyNames.FileSize)] public long? FileSize { get; set; } /// /// Optional. Thumbnail of the album cover to which the music file belongs /// [JsonPropertyName(PropertyNames.Thumbnail)] public PhotoSize? Thumbnail { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BackgroundFill/BackgroundFill.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the way a background is filled based on the selected colors. Currently, it can be one of /// /// /// /// /// /// [JsonConverter(typeof(BackgroundFillConverter))] public abstract class BackgroundFill { /// /// Type of the background fill /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BackgroundFill/BackgroundFillFreeformGradient.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The background is a freeform gradient that rotates after every message in the chat. /// public class BackgroundFillFreeformGradient : BackgroundFill { /// /// Type of the background fill, always “freeform_gradient” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "freeform_gradient"; /// /// A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format /// [JsonPropertyName(PropertyNames.Colors)] public IEnumerable Colors { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BackgroundFill/BackgroundFillGradient.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The background is a gradient fill. /// public class BackgroundFillGradient : BackgroundFill { /// /// Type of the background fill, always “gradient” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "gradient"; /// /// Top color of the gradient in the RGB24 format /// [JsonPropertyName(PropertyNames.TopColor)] public int TopColor { get; set; } /// /// Bottom color of the gradient in the RGB24 format /// [JsonPropertyName(PropertyNames.BottomColor)] public int BottomColor { get; set; } /// /// Clockwise rotation angle of the background fill in degrees; 0-359 /// [JsonPropertyName(PropertyNames.RotationAngle)] public int RotationAngle { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BackgroundFill/BackgroundFillSolid.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The background is filled using the selected color. /// public class BackgroundFillSolid : BackgroundFill { /// /// Type of the background fill, always “solid” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "solid"; /// /// The color of the background fill in the RGB24 format /// [JsonPropertyName(PropertyNames.Color)] public int Color { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BackgroundType/BackgroundType.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the type of a background. Currently, it can be one of /// /// /// /// /// /// /// [JsonConverter(typeof(BackgroundTypeConverter))] public abstract class BackgroundType { /// /// Type of the background /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BackgroundType/BackgroundTypeChatTheme.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The background is taken directly from a built-in chat theme. /// public class BackgroundTypeChatTheme : BackgroundType { /// /// Type of the background, always “chat_theme” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "chat_theme"; /// /// Name of the chat theme, which is usually an emoji /// [JsonPropertyName(PropertyNames.ThemeName)] public string ThemeName { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BackgroundType/BackgroundTypeFill.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The background is automatically filled based on the selected colors. /// public class BackgroundTypeFill : BackgroundType { /// /// Type of the background, always “fill” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "fill"; /// /// The background fill /// [JsonPropertyName(PropertyNames.Fill)] public BackgroundFill Fill { get; set; } = null!; /// /// Dimming of the background in dark themes, as a percentage; 0-100 /// [JsonPropertyName(PropertyNames.DarkThemeDimming)] public int DarkThemeDimming { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BackgroundType/BackgroundTypePattern.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user. /// public class BackgroundTypePattern : BackgroundType { /// /// Type of the background, always “pattern” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "pattern"; /// /// Document with the pattern /// [JsonPropertyName(PropertyNames.Document)] public Document Document { get; set; } = null!; /// /// The background fill that is combined with the pattern /// [JsonPropertyName(PropertyNames.Fill)] public BackgroundFill Fill { get; set; } = null!; /// /// Intensity of the pattern when it is shown above the filled background; 0-100 /// [JsonPropertyName(PropertyNames.Intensity)] public int Intensity { get; set; } /// /// Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only /// [JsonPropertyName(PropertyNames.IsInverted)] public bool? IsInverted { get; set; } /// /// Optional. True, if the background moves slightly when the device is tilted /// [JsonPropertyName(PropertyNames.IsMoving)] public bool? IsMoving { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BackgroundType/BackgroundTypeWallpaper.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The background is a wallpaper in the JPEG format. /// public class BackgroundTypeWallpaper : BackgroundType { /// /// Type of the background, always “wallpaper” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "wallpaper"; /// /// Document with the wallpaper /// [JsonPropertyName(PropertyNames.Document)] public Document Document { get; set; } = null!; /// /// Dimming of the background in dark themes, as a percentage; 0-100 /// [JsonPropertyName(PropertyNames.DarkThemeDimming)] public int DarkThemeDimming { get; set; } /// /// Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12 /// [JsonPropertyName(PropertyNames.IsBlurred)] public bool? IsBlurred { get; set; } /// /// Optional. True, if the background moves slightly when the device is tilted /// [JsonPropertyName(PropertyNames.IsMoving)] public bool? IsMoving { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Birthdate.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes the birthdate of a user. /// public class Birthdate { /// /// Day of the user's birth; 1-31 /// [JsonPropertyName(PropertyNames.Day)] public int Day { get; set; } /// /// Month of the user's birth; 1-12 /// [JsonPropertyName(PropertyNames.Month)] public int Month { get; set; } /// /// Optional. Year of the user's birth /// [JsonPropertyName(PropertyNames.Year)] public int? Year { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotAccessSettings.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the access settings of a bot. /// public class BotAccessSettings { /// /// True, if only selected users can access the bot. The bot's owner can always access it. /// [JsonPropertyName(PropertyNames.IsAccessRestricted)] public bool IsAccessRestricted { get; set; } /// /// Optional. The list of other users who have access to the bot if the access is restricted /// [JsonPropertyName(PropertyNames.AddedUsers)] public IEnumerable? AddedUsers { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotCommand.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a bot command. /// public class BotCommand { /// /// Initializes a new instance of the class. /// /// Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. /// Description of the command; 1-256 characters. public BotCommand(string command, string description) { this.Command = command ?? throw new ArgumentNullException(nameof(command)); this.Description = description ?? throw new ArgumentNullException(nameof(description)); } /// /// Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. /// [JsonPropertyName(PropertyNames.Command)] public string Command { get; set; } /// /// Description of the command; 1-256 characters. /// [JsonPropertyName(PropertyNames.Description)] public string Description { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotCommandScope/BotCommandScope.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported: /// /// /// /// /// /// /// /// /// /// [JsonConverter(typeof(BotCommandScopeConverter))] public abstract class BotCommandScope { /// /// Scope type /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotCommandScope/BotCommandScopeAllChatAdministrators.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents the scope of bot commands, covering all group and supergroup chat administrators. /// public class BotCommandScopeAllChatAdministrators : BotCommandScope { /// /// Scope type, must be all_chat_administrators /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "all_chat_administrators"; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotCommandScope/BotCommandScopeAllGroupChats.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents the scope of bot commands, covering all group and supergroup chats. /// public class BotCommandScopeAllGroupChats : BotCommandScope { /// /// Scope type, must be all_group_chats /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "all_group_chats"; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotCommandScope/BotCommandScopeAllPrivateChats.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents the scope of bot commands, covering all private chats. /// public class BotCommandScopeAllPrivateChats : BotCommandScope { /// /// Scope type, must be all_private_chats /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "all_private_chats"; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotCommandScope/BotCommandScopeChat.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents the scope of bot commands, covering a specific chat. /// public class BotCommandScopeChat : BotCommandScope { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported. public BotCommandScopeChat(long chatId) { this.ChatId = chatId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported. public BotCommandScopeChat(string chatId) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); } /// /// Scope type, must be chat /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "chat"; /// /// Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported. /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotCommandScope/BotCommandScopeChatAdministrators.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat. /// public class BotCommandScopeChatAdministrators : BotCommandScope { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported. public BotCommandScopeChatAdministrators(long chatId) { this.ChatId = chatId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported. public BotCommandScopeChatAdministrators(string chatId) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); } /// /// Scope type, must be chat_administrators /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "chat_administrators"; /// /// Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported. /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotCommandScope/BotCommandScopeChatMember.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents the scope of bot commands, covering a specific member of a group or supergroup chat. /// public class BotCommandScopeChatMember : BotCommandScope { /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported. /// Unique identifier of the target user public BotCommandScopeChatMember(long chatId, long userId) { this.ChatId = chatId; this.UserId = userId; } /// /// Initializes a new instance of the class. /// /// Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported. /// Unique identifier of the target user public BotCommandScopeChatMember(string chatId, long userId) { this.ChatId = chatId ?? throw new ArgumentNullException(nameof(chatId)); this.UserId = userId; } /// /// Scope type, must be chat_member /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "chat_member"; /// /// Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported. /// [JsonPropertyName(PropertyNames.ChatId)] public object ChatId { get; set; } /// /// Unique identifier of the target user /// [JsonPropertyName(PropertyNames.UserId)] public long UserId { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotCommandScope/BotCommandScopeDefault.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user. /// public class BotCommandScopeDefault : BotCommandScope { /// /// Scope type, must be default /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "default"; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotDescription.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents the bot's description. /// public class BotDescription { /// /// The bot's description /// [JsonPropertyName(PropertyNames.Description)] public string Description { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotName.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents the bot's name. /// public class BotName { /// /// The bot's name /// [JsonPropertyName(PropertyNames.Name)] public string Name { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BotShortDescription.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents the bot's short description. /// public class BotShortDescription { /// /// The bot's short description /// [JsonPropertyName(PropertyNames.ShortDescription)] public string ShortDescription { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BusinessBotRights.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents the rights of a business bot. /// public class BusinessBotRights { /// /// Optional. True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours /// [JsonPropertyName(PropertyNames.CanReply)] public bool? CanReply { get; set; } /// /// Optional. True, if the bot can mark incoming private messages as read /// [JsonPropertyName(PropertyNames.CanReadMessages)] public bool? CanReadMessages { get; set; } /// /// Optional. True, if the bot can delete messages sent by the bot /// [JsonPropertyName(PropertyNames.CanDeleteSentMessages)] public bool? CanDeleteSentMessages { get; set; } /// /// Optional. True, if the bot can delete all private messages in managed chats /// [JsonPropertyName(PropertyNames.CanDeleteAllMessages)] public bool? CanDeleteAllMessages { get; set; } /// /// Optional. True, if the bot can edit the first and last name of the business account /// [JsonPropertyName(PropertyNames.CanEditName)] public bool? CanEditName { get; set; } /// /// Optional. True, if the bot can edit the bio of the business account /// [JsonPropertyName(PropertyNames.CanEditBio)] public bool? CanEditBio { get; set; } /// /// Optional. True, if the bot can edit the profile photo of the business account /// [JsonPropertyName(PropertyNames.CanEditProfilePhoto)] public bool? CanEditProfilePhoto { get; set; } /// /// Optional. True, if the bot can edit the username of the business account /// [JsonPropertyName(PropertyNames.CanEditUsername)] public bool? CanEditUsername { get; set; } /// /// Optional. True, if the bot can change the privacy settings pertaining to gifts for the business account /// [JsonPropertyName(PropertyNames.CanChangeGiftSettings)] public bool? CanChangeGiftSettings { get; set; } /// /// Optional. True, if the bot can view gifts and the amount of Telegram Stars owned by the business account /// [JsonPropertyName(PropertyNames.CanViewGiftsAndStars)] public bool? CanViewGiftsAndStars { get; set; } /// /// Optional. True, if the bot can convert regular gifts owned by the business account to Telegram Stars /// [JsonPropertyName(PropertyNames.CanConvertGiftsToStars)] public bool? CanConvertGiftsToStars { get; set; } /// /// Optional. True, if the bot can transfer and upgrade gifts owned by the business account /// [JsonPropertyName(PropertyNames.CanTransferAndUpgradeGifts)] public bool? CanTransferAndUpgradeGifts { get; set; } /// /// Optional. True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts /// [JsonPropertyName(PropertyNames.CanTransferStars)] public bool? CanTransferStars { get; set; } /// /// Optional. True, if the bot can post, edit and delete stories on behalf of the business account /// [JsonPropertyName(PropertyNames.CanManageStories)] public bool? CanManageStories { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BusinessConnection.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes the connection of the bot with a business account. /// public class BusinessConnection { /// /// Unique identifier of the business connection /// [JsonPropertyName(PropertyNames.Id)] public string Id { get; set; } = null!; /// /// Business account user that created the business connection /// [JsonPropertyName(PropertyNames.User)] public User User { get; set; } = null!; /// /// Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. /// [JsonPropertyName(PropertyNames.UserChatId)] public long UserChatId { get; set; } /// /// Date the connection was established in Unix time /// [JsonPropertyName(PropertyNames.Date)] public int Date { get; set; } /// /// Optional. Rights of the business bot /// [JsonPropertyName(PropertyNames.Rights)] public BusinessBotRights? Rights { get; set; } /// /// True, if the connection is active /// [JsonPropertyName(PropertyNames.IsEnabled)] public bool IsEnabled { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BusinessIntro.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Stickers; namespace Telegram.BotAPI.AvailableTypes; /// /// Contains information about the start page settings of a Telegram Business account. /// public class BusinessIntro { /// /// Optional. Title text of the business intro /// [JsonPropertyName(PropertyNames.Title)] public string? Title { get; set; } /// /// Optional. Message text of the business intro /// [JsonPropertyName(PropertyNames.Message)] public string? Message { get; set; } /// /// Optional. Sticker of the business intro /// [JsonPropertyName(PropertyNames.Sticker)] public Sticker? Sticker { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BusinessLocation.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Contains information about the location of a Telegram Business account. /// public class BusinessLocation { /// /// Address of the business /// [JsonPropertyName(PropertyNames.Address)] public string Address { get; set; } = null!; /// /// Optional. Location of the business /// [JsonPropertyName(PropertyNames.Location)] public Location? Location { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BusinessMessagesDeleted.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object is received when messages are deleted from a connected business account. /// public class BusinessMessagesDeleted { /// /// Unique identifier of the business connection /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string BusinessConnectionId { get; set; } = null!; /// /// Information about a chat in the business account. The bot may not have access to the chat or the corresponding user. /// [JsonPropertyName(PropertyNames.Chat)] public Chat Chat { get; set; } = null!; /// /// The list of identifiers of deleted messages in the chat of the business account /// [JsonPropertyName(PropertyNames.MessageIds)] public IEnumerable MessageIds { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BusinessOpeningHours.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes the opening hours of a business. /// public class BusinessOpeningHours { /// /// Unique name of the time zone for which the opening hours are defined /// [JsonPropertyName(PropertyNames.TimeZoneName)] public string TimeZoneName { get; set; } = null!; /// /// List of time intervals describing business opening hours /// [JsonPropertyName(PropertyNames.OpeningHours)] public IEnumerable OpeningHours { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/BusinessOpeningHoursInterval.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes an interval of time during which a business is open. /// public class BusinessOpeningHoursInterval { /// /// The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60 /// [JsonPropertyName(PropertyNames.OpeningMinute)] public int OpeningMinute { get; set; } /// /// The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60 /// [JsonPropertyName(PropertyNames.ClosingMinute)] public int ClosingMinute { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/CallbackQuery.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Games; namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present. /// public class CallbackQuery { /// /// Unique identifier for this query /// [JsonPropertyName(PropertyNames.Id)] public string Id { get; set; } = null!; /// /// Sender /// [JsonPropertyName(PropertyNames.From)] public User From { get; set; } = null!; /// /// Optional. Message sent by the bot with the callback button that originated the query /// [JsonPropertyName(PropertyNames.Message)] public MaybeInaccessibleMessage? Message { get; set; } /// /// Optional. Identifier of the message sent via the bot in inline mode, that originated the query. /// [JsonPropertyName(PropertyNames.InlineMessageId)] public string? InlineMessageId { get; set; } /// /// Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. /// [JsonPropertyName(PropertyNames.ChatInstance)] public string ChatInstance { get; set; } = null!; /// /// Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data. /// [JsonPropertyName(PropertyNames.Data)] public string? Data { get; set; } /// /// Optional. Short name of a to be returned, serves as the unique identifier for the game /// [JsonPropertyName(PropertyNames.GameShortName)] public string? GameShortName { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Chat/Chat.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a chat. /// public class Chat { /// /// Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. /// [JsonPropertyName(PropertyNames.Id)] public long Id { get; set; } /// /// Type of the chat, can be either “private”, “group”, “supergroup” or “channel” /// [JsonPropertyName(PropertyNames.Type)] public string Type { get; set; } = null!; /// /// Optional. Title, for supergroups, channels and group chats /// [JsonPropertyName(PropertyNames.Title)] public string? Title { get; set; } /// /// Optional. Username, for private chats, supergroups and channels if available /// [JsonPropertyName(PropertyNames.Username)] public string? Username { get; set; } /// /// Optional. First name of the other party in a private chat /// [JsonPropertyName(PropertyNames.FirstName)] public string? FirstName { get; set; } /// /// Optional. Last name of the other party in a private chat /// [JsonPropertyName(PropertyNames.LastName)] public string? LastName { get; set; } /// /// Optional. True, if the supergroup chat is a forum (has topics enabled) /// [JsonPropertyName(PropertyNames.IsForum)] public bool? IsForum { get; set; } /// /// Optional. True, if the chat is the direct messages chat of a channel /// [JsonPropertyName(PropertyNames.IsDirectMessages)] public bool? IsDirectMessages { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Chat/ChatFullInfo.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains full information about a chat. /// public class ChatFullInfo : Chat { /// /// Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. /// [JsonPropertyName(PropertyNames.AccentColorId)] public int AccentColorId { get; set; } /// /// The maximum number of reactions that can be set on a message in the chat /// [JsonPropertyName(PropertyNames.MaxReactionCount)] public int MaxReactionCount { get; set; } /// /// Optional. Chat photo /// [JsonPropertyName(PropertyNames.Photo)] public ChatPhoto? Photo { get; set; } /// /// Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels /// [JsonPropertyName(PropertyNames.ActiveUsernames)] public IEnumerable? ActiveUsernames { get; set; } /// /// Optional. For private chats, the date of birth of the user /// [JsonPropertyName(PropertyNames.Birthdate)] public Birthdate? Birthdate { get; set; } /// /// Optional. For private chats with business accounts, the intro of the business /// [JsonPropertyName(PropertyNames.BusinessIntro)] public BusinessIntro? BusinessIntro { get; set; } /// /// Optional. For private chats with business accounts, the location of the business /// [JsonPropertyName(PropertyNames.BusinessLocation)] public BusinessLocation? BusinessLocation { get; set; } /// /// Optional. For private chats with business accounts, the opening hours of the business /// [JsonPropertyName(PropertyNames.BusinessOpeningHours)] public BusinessOpeningHours? BusinessOpeningHours { get; set; } /// /// Optional. For private chats, the personal channel of the user /// [JsonPropertyName(PropertyNames.PersonalChat)] public Chat? PersonalChat { get; set; } /// /// Optional. Information about the corresponding channel chat; for direct messages chats only /// [JsonPropertyName(PropertyNames.ParentChat)] public Chat? ParentChat { get; set; } /// /// Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. /// [JsonPropertyName(PropertyNames.AvailableReactions)] public IEnumerable? AvailableReactions { get; set; } /// /// Optional. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background /// [JsonPropertyName(PropertyNames.BackgroundCustomEmojiId)] public string? BackgroundCustomEmojiId { get; set; } /// /// Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details. /// [JsonPropertyName(PropertyNames.ProfileAccentColorId)] public int? ProfileAccentColorId { get; set; } /// /// Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background /// [JsonPropertyName(PropertyNames.ProfileBackgroundCustomEmojiId)] public string? ProfileBackgroundCustomEmojiId { get; set; } /// /// Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat /// [JsonPropertyName(PropertyNames.EmojiStatusCustomEmojiId)] public string? EmojiStatusCustomEmojiId { get; set; } /// /// Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any /// [JsonPropertyName(PropertyNames.EmojiStatusExpirationDate)] public int? EmojiStatusExpirationDate { get; set; } /// /// Optional. Bio of the other party in a private chat /// [JsonPropertyName(PropertyNames.Bio)] public string? Bio { get; set; } /// /// Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user /// [JsonPropertyName(PropertyNames.HasPrivateForwards)] public bool? HasPrivateForwards { get; set; } /// /// Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat /// [JsonPropertyName(PropertyNames.HasRestrictedVoiceAndVideoMessages)] public bool? HasRestrictedVoiceAndVideoMessages { get; set; } /// /// Optional. True, if users need to join the supergroup before they can send messages /// [JsonPropertyName(PropertyNames.JoinToSendMessages)] public bool? JoinToSendMessages { get; set; } /// /// Optional. True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators /// [JsonPropertyName(PropertyNames.JoinByRequest)] public bool? JoinByRequest { get; set; } /// /// Optional. Description, for groups, supergroups and channel chats /// [JsonPropertyName(PropertyNames.Description)] public string? Description { get; set; } /// /// Optional. Primary invite link, for groups, supergroups and channel chats /// [JsonPropertyName(PropertyNames.InviteLink)] public string? InviteLink { get; set; } /// /// Optional. The most recent pinned message (by sending date) /// [JsonPropertyName(PropertyNames.PinnedMessage)] public Message? PinnedMessage { get; set; } /// /// Optional. Default chat member permissions, for groups and supergroups /// [JsonPropertyName(PropertyNames.Permissions)] public ChatPermissions? Permissions { get; set; } /// /// Information about types of gifts that are accepted by the chat or by the corresponding user for private chats /// [JsonPropertyName(PropertyNames.AcceptedGiftTypes)] public AcceptedGiftTypes AcceptedGiftTypes { get; set; } = null!; /// /// Optional. True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. /// [JsonPropertyName(PropertyNames.CanSendPaidMedia)] public bool? CanSendPaidMedia { get; set; } /// /// Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds /// [JsonPropertyName(PropertyNames.SlowModeDelay)] public int? SlowModeDelay { get; set; } /// /// Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions /// [JsonPropertyName(PropertyNames.UnrestrictBoostCount)] public int? UnrestrictBoostCount { get; set; } /// /// Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds /// [JsonPropertyName(PropertyNames.MessageAutoDeleteTime)] public int? MessageAutoDeleteTime { get; set; } /// /// Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. /// [JsonPropertyName(PropertyNames.HasAggressiveAntiSpamEnabled)] public bool? HasAggressiveAntiSpamEnabled { get; set; } /// /// Optional. True, if non-administrators can only get the list of bots and administrators in the chat /// [JsonPropertyName(PropertyNames.HasHiddenMembers)] public bool? HasHiddenMembers { get; set; } /// /// Optional. True, if messages from the chat can't be forwarded to other chats /// [JsonPropertyName(PropertyNames.HasProtectedContent)] public bool? HasProtectedContent { get; set; } /// /// Optional. True, if new chat members will have access to old messages; available only to chat administrators /// [JsonPropertyName(PropertyNames.HasVisibleHistory)] public bool? HasVisibleHistory { get; set; } /// /// Optional. For supergroups, name of the group sticker set /// [JsonPropertyName(PropertyNames.StickerSetName)] public string? StickerSetName { get; set; } /// /// Optional. True, if the bot can change the group sticker set /// [JsonPropertyName(PropertyNames.CanSetStickerSet)] public bool? CanSetStickerSet { get; set; } /// /// Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. /// [JsonPropertyName(PropertyNames.CustomEmojiStickerSetName)] public string? CustomEmojiStickerSetName { get; set; } /// /// Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. /// [JsonPropertyName(PropertyNames.LinkedChatId)] public long? LinkedChatId { get; set; } /// /// Optional. For supergroups, the location to which the supergroup is connected /// [JsonPropertyName(PropertyNames.Location)] public ChatLocation? Location { get; set; } /// /// Optional. For private chats, the rating of the user if any /// [JsonPropertyName(PropertyNames.Rating)] public UserRating? Rating { get; set; } /// /// Optional. For private chats, the first audio added to the profile of the user /// [JsonPropertyName(PropertyNames.FirstProfileAudio)] public Audio? FirstProfileAudio { get; set; } /// /// Optional. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews /// [JsonPropertyName(PropertyNames.UniqueGiftColors)] public UniqueGiftColors? UniqueGiftColors { get; set; } /// /// Optional. The number of Telegram Stars a general user have to pay to send a message to the chat /// [JsonPropertyName(PropertyNames.PaidMessageStarCount)] public int? PaidMessageStarCount { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatAdministratorRights.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents the rights of an administrator in a chat. /// public class ChatAdministratorRights { /// /// True, if the user's presence in the chat is hidden /// [JsonPropertyName(PropertyNames.IsAnonymous)] public bool IsAnonymous { get; set; } /// /// True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. /// [JsonPropertyName(PropertyNames.CanManageChat)] public bool CanManageChat { get; set; } /// /// True, if the administrator can delete messages of other users /// [JsonPropertyName(PropertyNames.CanDeleteMessages)] public bool CanDeleteMessages { get; set; } /// /// True, if the administrator can manage video chats /// [JsonPropertyName(PropertyNames.CanManageVideoChats)] public bool CanManageVideoChats { get; set; } /// /// True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics /// [JsonPropertyName(PropertyNames.CanRestrictMembers)] public bool CanRestrictMembers { get; set; } /// /// True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) /// [JsonPropertyName(PropertyNames.CanPromoteMembers)] public bool CanPromoteMembers { get; set; } /// /// True, if the user is allowed to change the chat title, photo and other settings /// [JsonPropertyName(PropertyNames.CanChangeInfo)] public bool CanChangeInfo { get; set; } /// /// True, if the user is allowed to invite new users to the chat /// [JsonPropertyName(PropertyNames.CanInviteUsers)] public bool CanInviteUsers { get; set; } /// /// True, if the administrator can post stories to the chat /// [JsonPropertyName(PropertyNames.CanPostStories)] public bool CanPostStories { get; set; } /// /// True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive /// [JsonPropertyName(PropertyNames.CanEditStories)] public bool CanEditStories { get; set; } /// /// True, if the administrator can delete stories posted by other users /// [JsonPropertyName(PropertyNames.CanDeleteStories)] public bool CanDeleteStories { get; set; } /// /// Optional. True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only /// [JsonPropertyName(PropertyNames.CanPostMessages)] public bool? CanPostMessages { get; set; } /// /// Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only /// [JsonPropertyName(PropertyNames.CanEditMessages)] public bool? CanEditMessages { get; set; } /// /// Optional. True, if the user is allowed to pin messages; for groups and supergroups only /// [JsonPropertyName(PropertyNames.CanPinMessages)] public bool? CanPinMessages { get; set; } /// /// Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only /// [JsonPropertyName(PropertyNames.CanManageTopics)] public bool? CanManageTopics { get; set; } /// /// Optional. True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only /// [JsonPropertyName(PropertyNames.CanManageDirectMessages)] public bool? CanManageDirectMessages { get; set; } /// /// Optional. True, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted defaults to the value of can_pin_messages. /// [JsonPropertyName(PropertyNames.CanManageTags)] public bool? CanManageTags { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatBackground.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a chat background. /// public class ChatBackground { /// /// Type of the background /// [JsonPropertyName(PropertyNames.Type)] public BackgroundType Type { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatBoost.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains information about a chat boost. /// public class ChatBoost { /// /// Unique identifier of the boost /// [JsonPropertyName(PropertyNames.BoostId)] public string BoostId { get; set; } = null!; /// /// Point in time (Unix timestamp) when the chat was boosted /// [JsonPropertyName(PropertyNames.AddDate)] public int AddDate { get; set; } /// /// Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged /// [JsonPropertyName(PropertyNames.ExpirationDate)] public int ExpirationDate { get; set; } /// /// Source of the added boost /// [JsonPropertyName(PropertyNames.Source)] public ChatBoostSource Source { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatBoostAdded.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a service message about a user boosting a chat. /// public class ChatBoostAdded { /// /// Number of boosts added by the user /// [JsonPropertyName(PropertyNames.BoostCount)] public int BoostCount { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatBoostRemoved.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a boost removed from a chat. /// public class ChatBoostRemoved { /// /// Chat which was boosted /// [JsonPropertyName(PropertyNames.Chat)] public Chat Chat { get; set; } = null!; /// /// Unique identifier of the boost /// [JsonPropertyName(PropertyNames.BoostId)] public string BoostId { get; set; } = null!; /// /// Point in time (Unix timestamp) when the boost was removed /// [JsonPropertyName(PropertyNames.RemoveDate)] public int RemoveDate { get; set; } /// /// Source of the removed boost /// [JsonPropertyName(PropertyNames.Source)] public ChatBoostSource Source { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatBoostSource/ChatBoostSource.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the source of a chat boost. It can be one of /// /// /// /// /// /// [JsonConverter(typeof(ChatBoostSourceConverter))] public abstract class ChatBoostSource { /// /// Source of the boost /// [JsonPropertyName(PropertyNames.Source)] public abstract string Source { get; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatBoostSource/ChatBoostSourceGiftCode.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription. /// public class ChatBoostSourceGiftCode : ChatBoostSource { /// /// Source of the boost, always “gift_code” /// [JsonPropertyName(PropertyNames.Source)] public override string Source => "gift_code"; /// /// User for which the gift code was created /// [JsonPropertyName(PropertyNames.User)] public User User { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatBoostSource/ChatBoostSourceGiveaway.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways. /// public class ChatBoostSourceGiveaway : ChatBoostSource { /// /// Source of the boost, always “giveaway” /// [JsonPropertyName(PropertyNames.Source)] public override string Source => "giveaway"; /// /// Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet. /// [JsonPropertyName(PropertyNames.GiveawayMessageId)] public int GiveawayMessageId { get; set; } /// /// Optional. User that won the prize in the giveaway if any; for Telegram Premium giveaways only /// [JsonPropertyName(PropertyNames.User)] public User? User { get; set; } /// /// Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only /// [JsonPropertyName(PropertyNames.PrizeStarCount)] public int? PrizeStarCount { get; set; } /// /// Optional. True, if the giveaway was completed, but there was no user to win the prize /// [JsonPropertyName(PropertyNames.IsUnclaimed)] public bool? IsUnclaimed { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatBoostSource/ChatBoostSourcePremium.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user. /// public class ChatBoostSourcePremium : ChatBoostSource { /// /// Source of the boost, always “premium” /// [JsonPropertyName(PropertyNames.Source)] public override string Source => "premium"; /// /// User that boosted the chat /// [JsonPropertyName(PropertyNames.User)] public User User { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatBoostUpdated.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a boost added to a chat or changed. /// public class ChatBoostUpdated { /// /// Chat which was boosted /// [JsonPropertyName(PropertyNames.Chat)] public Chat Chat { get; set; } = null!; /// /// Information about the chat boost /// [JsonPropertyName(PropertyNames.Boost)] public ChatBoost Boost { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatInviteLink.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents an invite link for a chat. /// public class ChatInviteLink { /// /// The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”. /// [JsonPropertyName(PropertyNames.InviteLink)] public string InviteLink { get; set; } = null!; /// /// Creator of the link /// [JsonPropertyName(PropertyNames.Creator)] public User Creator { get; set; } = null!; /// /// True, if users joining the chat via the link need to be approved by chat administrators /// [JsonPropertyName(PropertyNames.CreatesJoinRequest)] public bool CreatesJoinRequest { get; set; } /// /// True, if the link is primary /// [JsonPropertyName(PropertyNames.IsPrimary)] public bool IsPrimary { get; set; } /// /// True, if the link is revoked /// [JsonPropertyName(PropertyNames.IsRevoked)] public bool IsRevoked { get; set; } /// /// Optional. Invite link name /// [JsonPropertyName(PropertyNames.Name)] public string? Name { get; set; } /// /// Optional. Point in time (Unix timestamp) when the link will expire or has been expired /// [JsonPropertyName(PropertyNames.ExpireDate)] public int? ExpireDate { get; set; } /// /// Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 /// [JsonPropertyName(PropertyNames.MemberLimit)] public int? MemberLimit { get; set; } /// /// Optional. Number of pending join requests created using this link /// [JsonPropertyName(PropertyNames.PendingJoinRequestCount)] public int? PendingJoinRequestCount { get; set; } /// /// Optional. The number of seconds the subscription will be active for before the next payment /// [JsonPropertyName(PropertyNames.SubscriptionPeriod)] public int? SubscriptionPeriod { get; set; } /// /// Optional. The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link /// [JsonPropertyName(PropertyNames.SubscriptionPrice)] public int? SubscriptionPrice { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatJoinRequest.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a join request sent to a chat. /// public class ChatJoinRequest { /// /// Chat to which the request was sent /// [JsonPropertyName(PropertyNames.Chat)] public Chat Chat { get; set; } = null!; /// /// User that sent the join request /// [JsonPropertyName(PropertyNames.From)] public User From { get; set; } = null!; /// /// Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. /// [JsonPropertyName(PropertyNames.UserChatId)] public long UserChatId { get; set; } /// /// Date the request was sent in Unix time /// [JsonPropertyName(PropertyNames.Date)] public int Date { get; set; } /// /// Optional. Bio of the user. /// [JsonPropertyName(PropertyNames.Bio)] public string? Bio { get; set; } /// /// Optional. Chat invite link that was used by the user to send the join request /// [JsonPropertyName(PropertyNames.InviteLink)] public ChatInviteLink? InviteLink { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatLocation.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a location to which a chat is connected. /// public class ChatLocation { /// /// The location to which the supergroup is connected. Can't be a live location. /// [JsonPropertyName(PropertyNames.Location)] public Location Location { get; set; } = null!; /// /// Location address; 1-64 characters, as defined by the chat owner /// [JsonPropertyName(PropertyNames.Address)] public string Address { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatMember/ChatMember.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported: /// /// /// /// /// /// /// /// /// [JsonConverter(typeof(ChatMemberConverter))] public abstract class ChatMember { /// /// The member's status in the chat /// [JsonPropertyName(PropertyNames.Status)] public abstract string Status { get; } /// /// Information about the user /// [JsonPropertyName(PropertyNames.User)] public User User { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatMember/ChatMemberAdministrator.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a chat member that has some additional privileges. /// public class ChatMemberAdministrator : ChatMember { /// /// The member's status in the chat, always “administrator” /// [JsonPropertyName(PropertyNames.Status)] public override string Status => "administrator"; /// /// True, if the bot is allowed to edit administrator privileges of that user /// [JsonPropertyName(PropertyNames.CanBeEdited)] public bool CanBeEdited { get; set; } /// /// True, if the user's presence in the chat is hidden /// [JsonPropertyName(PropertyNames.IsAnonymous)] public bool IsAnonymous { get; set; } /// /// True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. /// [JsonPropertyName(PropertyNames.CanManageChat)] public bool CanManageChat { get; set; } /// /// True, if the administrator can delete messages of other users /// [JsonPropertyName(PropertyNames.CanDeleteMessages)] public bool CanDeleteMessages { get; set; } /// /// True, if the administrator can manage video chats /// [JsonPropertyName(PropertyNames.CanManageVideoChats)] public bool CanManageVideoChats { get; set; } /// /// True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics /// [JsonPropertyName(PropertyNames.CanRestrictMembers)] public bool CanRestrictMembers { get; set; } /// /// True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) /// [JsonPropertyName(PropertyNames.CanPromoteMembers)] public bool CanPromoteMembers { get; set; } /// /// True, if the user is allowed to change the chat title, photo and other settings /// [JsonPropertyName(PropertyNames.CanChangeInfo)] public bool CanChangeInfo { get; set; } /// /// True, if the user is allowed to invite new users to the chat /// [JsonPropertyName(PropertyNames.CanInviteUsers)] public bool CanInviteUsers { get; set; } /// /// True, if the administrator can post stories to the chat /// [JsonPropertyName(PropertyNames.CanPostStories)] public bool CanPostStories { get; set; } /// /// True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive /// [JsonPropertyName(PropertyNames.CanEditStories)] public bool CanEditStories { get; set; } /// /// True, if the administrator can delete stories posted by other users /// [JsonPropertyName(PropertyNames.CanDeleteStories)] public bool CanDeleteStories { get; set; } /// /// Optional. True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only /// [JsonPropertyName(PropertyNames.CanPostMessages)] public bool? CanPostMessages { get; set; } /// /// Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only /// [JsonPropertyName(PropertyNames.CanEditMessages)] public bool? CanEditMessages { get; set; } /// /// Optional. True, if the user is allowed to pin messages; for groups and supergroups only /// [JsonPropertyName(PropertyNames.CanPinMessages)] public bool? CanPinMessages { get; set; } /// /// Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only /// [JsonPropertyName(PropertyNames.CanManageTopics)] public bool? CanManageTopics { get; set; } /// /// Optional. True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only /// [JsonPropertyName(PropertyNames.CanManageDirectMessages)] public bool? CanManageDirectMessages { get; set; } /// /// Optional. True, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted defaults to the value of can_pin_messages. /// [JsonPropertyName(PropertyNames.CanManageTags)] public bool? CanManageTags { get; set; } /// /// Optional. Custom title for this user /// [JsonPropertyName(PropertyNames.CustomTitle)] public string? CustomTitle { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatMember/ChatMemberBanned.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a chat member that was banned in the chat and can't return to the chat or view chat messages. /// public class ChatMemberBanned : ChatMember { /// /// The member's status in the chat, always “kicked” /// [JsonPropertyName(PropertyNames.Status)] public override string Status => "kicked"; /// /// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever /// [JsonPropertyName(PropertyNames.UntilDate)] public int UntilDate { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatMember/ChatMemberLeft.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a chat member that isn't currently a member of the chat, but may join it themselves. /// public class ChatMemberLeft : ChatMember { /// /// The member's status in the chat, always “left” /// [JsonPropertyName(PropertyNames.Status)] public override string Status => "left"; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatMember/ChatMemberMember.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a chat member that has no additional privileges or restrictions. /// public class ChatMemberMember : ChatMember { /// /// The member's status in the chat, always “member” /// [JsonPropertyName(PropertyNames.Status)] public override string Status => "member"; /// /// Optional. Tag of the member /// [JsonPropertyName(PropertyNames.Tag)] public string? Tag { get; set; } /// /// Optional. Date when the user's subscription will expire; Unix time /// [JsonPropertyName(PropertyNames.UntilDate)] public int? UntilDate { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatMember/ChatMemberOwner.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a chat member that owns the chat and has all administrator privileges. /// public class ChatMemberOwner : ChatMember { /// /// The member's status in the chat, always “creator” /// [JsonPropertyName(PropertyNames.Status)] public override string Status => "creator"; /// /// True, if the user's presence in the chat is hidden /// [JsonPropertyName(PropertyNames.IsAnonymous)] public bool IsAnonymous { get; set; } /// /// Optional. Custom title for this user /// [JsonPropertyName(PropertyNames.CustomTitle)] public string? CustomTitle { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatMember/ChatMemberRestricted.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a chat member that is under certain restrictions in the chat. Supergroups only. /// public class ChatMemberRestricted : ChatMember { /// /// The member's status in the chat, always “restricted” /// [JsonPropertyName(PropertyNames.Status)] public override string Status => "restricted"; /// /// Optional. Tag of the member /// [JsonPropertyName(PropertyNames.Tag)] public string? Tag { get; set; } /// /// True, if the user is a member of the chat at the moment of the request /// [JsonPropertyName(PropertyNames.IsMember)] public bool IsMember { get; set; } /// /// True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues /// [JsonPropertyName(PropertyNames.CanSendMessages)] public bool CanSendMessages { get; set; } /// /// True, if the user is allowed to send audios /// [JsonPropertyName(PropertyNames.CanSendAudios)] public bool CanSendAudios { get; set; } /// /// True, if the user is allowed to send documents /// [JsonPropertyName(PropertyNames.CanSendDocuments)] public bool CanSendDocuments { get; set; } /// /// True, if the user is allowed to send photos /// [JsonPropertyName(PropertyNames.CanSendPhotos)] public bool CanSendPhotos { get; set; } /// /// True, if the user is allowed to send videos /// [JsonPropertyName(PropertyNames.CanSendVideos)] public bool CanSendVideos { get; set; } /// /// True, if the user is allowed to send video notes /// [JsonPropertyName(PropertyNames.CanSendVideoNotes)] public bool CanSendVideoNotes { get; set; } /// /// True, if the user is allowed to send voice notes /// [JsonPropertyName(PropertyNames.CanSendVoiceNotes)] public bool CanSendVoiceNotes { get; set; } /// /// True, if the user is allowed to send polls and checklists /// [JsonPropertyName(PropertyNames.CanSendPolls)] public bool CanSendPolls { get; set; } /// /// True, if the user is allowed to send animations, games, stickers and use inline bots /// [JsonPropertyName(PropertyNames.CanSendOtherMessages)] public bool CanSendOtherMessages { get; set; } /// /// True, if the user is allowed to add web page previews to their messages /// [JsonPropertyName(PropertyNames.CanAddWebPagePreviews)] public bool CanAddWebPagePreviews { get; set; } /// /// True, if the user is allowed to react to messages /// [JsonPropertyName(PropertyNames.CanReactToMessages)] public bool CanReactToMessages { get; set; } /// /// True, if the user is allowed to edit their own tag /// [JsonPropertyName(PropertyNames.CanEditTag)] public bool CanEditTag { get; set; } /// /// True, if the user is allowed to change the chat title, photo and other settings /// [JsonPropertyName(PropertyNames.CanChangeInfo)] public bool CanChangeInfo { get; set; } /// /// True, if the user is allowed to invite new users to the chat /// [JsonPropertyName(PropertyNames.CanInviteUsers)] public bool CanInviteUsers { get; set; } /// /// True, if the user is allowed to pin messages /// [JsonPropertyName(PropertyNames.CanPinMessages)] public bool CanPinMessages { get; set; } /// /// True, if the user is allowed to create forum topics /// [JsonPropertyName(PropertyNames.CanManageTopics)] public bool CanManageTopics { get; set; } /// /// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever /// [JsonPropertyName(PropertyNames.UntilDate)] public int UntilDate { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatMemberUpdated.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents changes in the status of a chat member. /// public class ChatMemberUpdated { /// /// Chat the user belongs to /// [JsonPropertyName(PropertyNames.Chat)] public Chat Chat { get; set; } = null!; /// /// Performer of the action, which resulted in the change /// [JsonPropertyName(PropertyNames.From)] public User From { get; set; } = null!; /// /// Date the change was done in Unix time /// [JsonPropertyName(PropertyNames.Date)] public int Date { get; set; } /// /// Previous information about the chat member /// [JsonPropertyName(PropertyNames.OldChatMember)] public ChatMember OldChatMember { get; set; } = null!; /// /// New information about the chat member /// [JsonPropertyName(PropertyNames.NewChatMember)] public ChatMember NewChatMember { get; set; } = null!; /// /// Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only. /// [JsonPropertyName(PropertyNames.InviteLink)] public ChatInviteLink? InviteLink { get; set; } /// /// Optional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator /// [JsonPropertyName(PropertyNames.ViaJoinRequest)] public bool? ViaJoinRequest { get; set; } /// /// Optional. True, if the user joined the chat via a chat folder invite link /// [JsonPropertyName(PropertyNames.ViaChatFolderInviteLink)] public bool? ViaChatFolderInviteLink { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatOwnerChanged.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about an ownership change in the chat. /// public class ChatOwnerChanged { /// /// The new owner of the chat /// [JsonPropertyName(PropertyNames.NewOwner)] public User NewOwner { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatOwnerLeft.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about the chat owner leaving the chat. /// public class ChatOwnerLeft { /// /// Optional. The user who will become the new owner of the chat if the previous owner does not return to the chat /// [JsonPropertyName(PropertyNames.NewOwner)] public User? NewOwner { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatPermissions.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes actions that a non-administrator user is allowed to take in a chat. /// public class ChatPermissions { /// /// Optional. True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues /// [JsonPropertyName(PropertyNames.CanSendMessages)] public bool? CanSendMessages { get; set; } /// /// Optional. True, if the user is allowed to send audios /// [JsonPropertyName(PropertyNames.CanSendAudios)] public bool? CanSendAudios { get; set; } /// /// Optional. True, if the user is allowed to send documents /// [JsonPropertyName(PropertyNames.CanSendDocuments)] public bool? CanSendDocuments { get; set; } /// /// Optional. True, if the user is allowed to send photos /// [JsonPropertyName(PropertyNames.CanSendPhotos)] public bool? CanSendPhotos { get; set; } /// /// Optional. True, if the user is allowed to send videos /// [JsonPropertyName(PropertyNames.CanSendVideos)] public bool? CanSendVideos { get; set; } /// /// Optional. True, if the user is allowed to send video notes /// [JsonPropertyName(PropertyNames.CanSendVideoNotes)] public bool? CanSendVideoNotes { get; set; } /// /// Optional. True, if the user is allowed to send voice notes /// [JsonPropertyName(PropertyNames.CanSendVoiceNotes)] public bool? CanSendVoiceNotes { get; set; } /// /// Optional. True, if the user is allowed to send polls and checklists /// [JsonPropertyName(PropertyNames.CanSendPolls)] public bool? CanSendPolls { get; set; } /// /// Optional. True, if the user is allowed to send animations, games, stickers and use inline bots /// [JsonPropertyName(PropertyNames.CanSendOtherMessages)] public bool? CanSendOtherMessages { get; set; } /// /// Optional. True, if the user is allowed to add web page previews to their messages /// [JsonPropertyName(PropertyNames.CanAddWebPagePreviews)] public bool? CanAddWebPagePreviews { get; set; } /// /// Optional. True, if the user is allowed to react to messages. If omitted, defaults to the value of can_send_messages. /// [JsonPropertyName(PropertyNames.CanReactToMessages)] public bool? CanReactToMessages { get; set; } /// /// Optional. True, if the user is allowed to edit their own tag. If omitted, defaults to the value of can_pin_messages. /// [JsonPropertyName(PropertyNames.CanEditTag)] public bool? CanEditTag { get; set; } /// /// Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups /// [JsonPropertyName(PropertyNames.CanChangeInfo)] public bool? CanChangeInfo { get; set; } /// /// Optional. True, if the user is allowed to invite new users to the chat /// [JsonPropertyName(PropertyNames.CanInviteUsers)] public bool? CanInviteUsers { get; set; } /// /// Optional. True, if the user is allowed to pin messages. Ignored in public supergroups /// [JsonPropertyName(PropertyNames.CanPinMessages)] public bool? CanPinMessages { get; set; } /// /// Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages /// [JsonPropertyName(PropertyNames.CanManageTopics)] public bool? CanManageTopics { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatPhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a chat photo. /// public class ChatPhoto { /// /// File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. /// [JsonPropertyName(PropertyNames.SmallFileId)] public string SmallFileId { get; set; } = null!; /// /// Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. /// [JsonPropertyName(PropertyNames.SmallFileUniqueId)] public string SmallFileUniqueId { get; set; } = null!; /// /// File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. /// [JsonPropertyName(PropertyNames.BigFileId)] public string BigFileId { get; set; } = null!; /// /// Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. /// [JsonPropertyName(PropertyNames.BigFileUniqueId)] public string BigFileUniqueId { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChatShared.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains information about a chat that was shared with the bot using a button. /// public class ChatShared { /// /// Identifier of the request /// [JsonPropertyName(PropertyNames.RequestId)] public int RequestId { get; set; } /// /// Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. /// [JsonPropertyName(PropertyNames.ChatId)] public long ChatId { get; set; } /// /// Optional. Title of the chat, if the title was requested by the bot. /// [JsonPropertyName(PropertyNames.Title)] public string? Title { get; set; } /// /// Optional. Username of the chat, if the username was requested by the bot and available. /// [JsonPropertyName(PropertyNames.Username)] public string? Username { get; set; } /// /// Optional. Available sizes of the chat photo, if the photo was requested by the bot /// [JsonPropertyName(PropertyNames.Photo)] public IEnumerable? Photo { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Checklist.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a checklist. /// public class Checklist { /// /// Title of the checklist /// [JsonPropertyName(PropertyNames.Title)] public string Title { get; set; } = null!; /// /// Optional. Special entities that appear in the checklist title /// [JsonPropertyName(PropertyNames.TitleEntities)] public IEnumerable? TitleEntities { get; set; } /// /// List of tasks in the checklist /// [JsonPropertyName(PropertyNames.Tasks)] public IEnumerable Tasks { get; set; } = null!; /// /// Optional. True, if users other than the creator of the list can add tasks to the list /// [JsonPropertyName(PropertyNames.OthersCanAddTasks)] public bool? OthersCanAddTasks { get; set; } /// /// Optional. True, if users other than the creator of the list can mark tasks as done or not done /// [JsonPropertyName(PropertyNames.OthersCanMarkTasksAsDone)] public bool? OthersCanMarkTasksAsDone { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChecklistTask.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a task in a checklist. /// public class ChecklistTask { /// /// Unique identifier of the task /// [JsonPropertyName(PropertyNames.Id)] public int Id { get; set; } /// /// Text of the task /// [JsonPropertyName(PropertyNames.Text)] public string Text { get; set; } = null!; /// /// Optional. Special entities that appear in the task text /// [JsonPropertyName(PropertyNames.TextEntities)] public IEnumerable? TextEntities { get; set; } /// /// Optional. User that completed the task; omitted if the task wasn't completed by a user /// [JsonPropertyName(PropertyNames.CompletedByUser)] public User? CompletedByUser { get; set; } /// /// Optional. Chat that completed the task; omitted if the task wasn't completed by a chat /// [JsonPropertyName(PropertyNames.CompletedByChat)] public Chat? CompletedByChat { get; set; } /// /// Optional. Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed /// [JsonPropertyName(PropertyNames.CompletionDate)] public int? CompletionDate { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChecklistTasksAdded.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about tasks added to a checklist. /// public class ChecklistTasksAdded { /// /// Optional. Message containing the checklist to which the tasks were added. Note that the object in this field will not contain the reply_to_message field even if it itself is a reply. /// [JsonPropertyName(PropertyNames.ChecklistMessage)] public Message? ChecklistMessage { get; set; } /// /// List of tasks added to the checklist /// [JsonPropertyName(PropertyNames.Tasks)] public IEnumerable Tasks { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ChecklistTasksDone.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about checklist tasks marked as done or not done. /// public class ChecklistTasksDone { /// /// Optional. Message containing the checklist whose tasks were marked as done or not done. Note that the object in this field will not contain the reply_to_message field even if it itself is a reply. /// [JsonPropertyName(PropertyNames.ChecklistMessage)] public Message? ChecklistMessage { get; set; } /// /// Optional. Identifiers of the tasks that were marked as done /// [JsonPropertyName(PropertyNames.MarkedAsDoneTaskIds)] public IEnumerable? MarkedAsDoneTaskIds { get; set; } /// /// Optional. Identifiers of the tasks that were marked as not done /// [JsonPropertyName(PropertyNames.MarkedAsNotDoneTaskIds)] public IEnumerable? MarkedAsNotDoneTaskIds { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Contact.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a phone contact. /// public class Contact { /// /// Contact's phone number /// [JsonPropertyName(PropertyNames.PhoneNumber)] public string PhoneNumber { get; set; } = null!; /// /// Contact's first name /// [JsonPropertyName(PropertyNames.FirstName)] public string FirstName { get; set; } = null!; /// /// Optional. Contact's last name /// [JsonPropertyName(PropertyNames.LastName)] public string? LastName { get; set; } /// /// Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. /// [JsonPropertyName(PropertyNames.UserId)] public long? UserId { get; set; } /// /// Optional. Additional data about the contact in the form of a vCard /// [JsonPropertyName(PropertyNames.Vcard)] public string? Vcard { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/CopyTextButton.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents an inline keyboard button that copies specified text to the clipboard. /// public class CopyTextButton { /// /// Initializes a new instance of the class. /// /// The text to be copied to the clipboard; 1-256 characters public CopyTextButton(string text) { this.Text = text ?? throw new ArgumentNullException(nameof(text)); } /// /// The text to be copied to the clipboard; 1-256 characters /// [JsonPropertyName(PropertyNames.Text)] public string Text { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Dice.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents an animated emoji that displays a random value. /// public class Dice { /// /// Emoji on which the dice throw animation is based /// [JsonPropertyName(PropertyNames.Emoji)] public string Emoji { get; set; } = null!; /// /// Value of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji /// [JsonPropertyName(PropertyNames.Value)] public int Value { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/DirectMessagePriceChanged.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about a change in the price of direct messages sent to a channel chat. /// public class DirectMessagePriceChanged { /// /// True, if direct messages are enabled for the channel chat; false otherwise /// [JsonPropertyName(PropertyNames.AreDirectMessagesEnabled)] public bool AreDirectMessagesEnabled { get; set; } /// /// Optional. The new number of Telegram Stars that must be paid by users for each direct message sent to the channel. Does not apply to users who have been exempted by administrators. Defaults to 0. /// [JsonPropertyName(PropertyNames.DirectMessageStarCount)] public int? DirectMessageStarCount { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/DirectMessagesTopic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a topic of a direct messages chat. /// public class DirectMessagesTopic { /// /// Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. /// [JsonPropertyName(PropertyNames.TopicId)] public int TopicId { get; set; } /// /// Optional. Information about the user that created the topic. Currently, it is always present /// [JsonPropertyName(PropertyNames.User)] public User? User { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Document.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a general file (as opposed to photos, voice messages and audio files). /// public class Document { /// /// Identifier for this file, which can be used to download or reuse the file /// [JsonPropertyName(PropertyNames.FileId)] public string FileId { get; set; } = null!; /// /// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. /// [JsonPropertyName(PropertyNames.FileUniqueId)] public string FileUniqueId { get; set; } = null!; /// /// Optional. Document thumbnail as defined by the sender /// [JsonPropertyName(PropertyNames.Thumbnail)] public PhotoSize? Thumbnail { get; set; } /// /// Optional. Original filename as defined by the sender /// [JsonPropertyName(PropertyNames.FileName)] public string? FileName { get; set; } /// /// Optional. MIME type of the file as defined by the sender /// [JsonPropertyName(PropertyNames.MimeType)] public string? MimeType { get; set; } /// /// Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. /// [JsonPropertyName(PropertyNames.FileSize)] public long? FileSize { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ExternalReplyInfo.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Games; using Telegram.BotAPI.Payments; using Telegram.BotAPI.Stickers; namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains information about a message that is being replied to, which may come from another chat or forum topic. /// public class ExternalReplyInfo { /// /// Origin of the message replied to by the given message /// [JsonPropertyName(PropertyNames.Origin)] public MessageOrigin Origin { get; set; } = null!; /// /// Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel. /// [JsonPropertyName(PropertyNames.Chat)] public Chat? Chat { get; set; } /// /// Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel. /// [JsonPropertyName(PropertyNames.MessageId)] public int? MessageId { get; set; } /// /// Optional. Options used for link preview generation for the original message, if it is a text message /// [JsonPropertyName(PropertyNames.LinkPreviewOptions)] public LinkPreviewOptions? LinkPreviewOptions { get; set; } /// /// Optional. Message is an animation, information about the animation /// [JsonPropertyName(PropertyNames.Animation)] public Animation? Animation { get; set; } /// /// Optional. Message is an audio file, information about the file /// [JsonPropertyName(PropertyNames.Audio)] public Audio? Audio { get; set; } /// /// Optional. Message is a general file, information about the file /// [JsonPropertyName(PropertyNames.Document)] public Document? Document { get; set; } /// /// Optional. Message is a live photo, information about the live photo /// [JsonPropertyName(PropertyNames.LivePhoto)] public LivePhoto? LivePhoto { get; set; } /// /// Optional. Message contains paid media; information about the paid media /// [JsonPropertyName(PropertyNames.PaidMedia)] public PaidMediaInfo? PaidMedia { get; set; } /// /// Optional. Message is a photo, available sizes of the photo /// [JsonPropertyName(PropertyNames.Photo)] public IEnumerable? Photo { get; set; } /// /// Optional. Message is a sticker, information about the sticker /// [JsonPropertyName(PropertyNames.Sticker)] public Sticker? Sticker { get; set; } /// /// Optional. Message is a forwarded story /// [JsonPropertyName(PropertyNames.Story)] public Story? Story { get; set; } /// /// Optional. Message is a video, information about the video /// [JsonPropertyName(PropertyNames.Video)] public Video? Video { get; set; } /// /// Optional. Message is a video note, information about the video message /// [JsonPropertyName(PropertyNames.VideoNote)] public VideoNote? VideoNote { get; set; } /// /// Optional. Message is a voice message, information about the file /// [JsonPropertyName(PropertyNames.Voice)] public Voice? Voice { get; set; } /// /// Optional. True, if the message media is covered by a spoiler animation /// [JsonPropertyName(PropertyNames.HasMediaSpoiler)] public bool? HasMediaSpoiler { get; set; } /// /// Optional. Message is a checklist /// [JsonPropertyName(PropertyNames.Checklist)] public Checklist? Checklist { get; set; } /// /// Optional. Message is a shared contact, information about the contact /// [JsonPropertyName(PropertyNames.Contact)] public Contact? Contact { get; set; } /// /// Optional. Message is a dice with random value /// [JsonPropertyName(PropertyNames.Dice)] public Dice? Dice { get; set; } /// /// Optional. Message is a game, information about the game. More about games » /// [JsonPropertyName(PropertyNames.Game)] public Game? Game { get; set; } /// /// Optional. Message is a scheduled giveaway, information about the giveaway /// [JsonPropertyName(PropertyNames.Giveaway)] public Giveaway? Giveaway { get; set; } /// /// Optional. A giveaway with public winners was completed /// [JsonPropertyName(PropertyNames.GiveawayWinners)] public GiveawayWinners? GiveawayWinners { get; set; } /// /// Optional. Message is an invoice for a payment, information about the invoice. More about payments » /// [JsonPropertyName(PropertyNames.Invoice)] public Invoice? Invoice { get; set; } /// /// Optional. Message is a shared location, information about the location /// [JsonPropertyName(PropertyNames.Location)] public Location? Location { get; set; } /// /// Optional. Message is a native poll, information about the poll /// [JsonPropertyName(PropertyNames.Poll)] public Poll? Poll { get; set; } /// /// Optional. Message is a venue, information about the venue /// [JsonPropertyName(PropertyNames.Venue)] public Venue? Venue { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/File.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile. /// public class File { /// /// Identifier for this file, which can be used to download or reuse the file /// [JsonPropertyName(PropertyNames.FileId)] public string FileId { get; set; } = null!; /// /// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. /// [JsonPropertyName(PropertyNames.FileUniqueId)] public string FileUniqueId { get; set; } = null!; /// /// Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. /// [JsonPropertyName(PropertyNames.FileSize)] public long? FileSize { get; set; } /// /// Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. /// [JsonPropertyName(PropertyNames.FilePath)] public string? FilePath { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ForumTopic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a forum topic. /// public class ForumTopic { /// /// Unique identifier of the forum topic /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int MessageThreadId { get; set; } /// /// Name of the topic /// [JsonPropertyName(PropertyNames.Name)] public string Name { get; set; } = null!; /// /// Color of the topic icon in RGB format /// [JsonPropertyName(PropertyNames.IconColor)] public int IconColor { get; set; } /// /// Optional. Unique identifier of the custom emoji shown as the topic icon /// [JsonPropertyName(PropertyNames.IconCustomEmojiId)] public string? IconCustomEmojiId { get; set; } /// /// Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot /// [JsonPropertyName(PropertyNames.IsNameImplicit)] public bool? IsNameImplicit { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ForumTopicClosed.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a service message about a forum topic closed in the chat. Currently holds no information. /// public class ForumTopicClosed { } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ForumTopicCreated.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a service message about a new forum topic created in the chat. /// public class ForumTopicCreated { /// /// Name of the topic /// [JsonPropertyName(PropertyNames.Name)] public string Name { get; set; } = null!; /// /// Color of the topic icon in RGB format /// [JsonPropertyName(PropertyNames.IconColor)] public int IconColor { get; set; } /// /// Optional. Unique identifier of the custom emoji shown as the topic icon /// [JsonPropertyName(PropertyNames.IconCustomEmojiId)] public string? IconCustomEmojiId { get; set; } /// /// Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot /// [JsonPropertyName(PropertyNames.IsNameImplicit)] public bool? IsNameImplicit { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ForumTopicEdited.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a service message about an edited forum topic. /// public class ForumTopicEdited { /// /// Optional. New name of the topic, if it was edited /// [JsonPropertyName(PropertyNames.Name)] public string? Name { get; set; } /// /// Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed /// [JsonPropertyName(PropertyNames.IconCustomEmojiId)] public string? IconCustomEmojiId { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ForumTopicReopened.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a service message about a forum topic reopened in the chat. Currently holds no information. /// public class ForumTopicReopened { } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/GeneralForumTopicHidden.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a service message about General forum topic hidden in the chat. Currently holds no information. /// public class GeneralForumTopicHidden { } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/GeneralForumTopicUnhidden.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a service message about General forum topic unhidden in the chat. Currently holds no information. /// public class GeneralForumTopicUnhidden { } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Gift.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Stickers; namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a gift that can be sent by the bot. /// public class Gift { /// /// Unique identifier of the gift /// [JsonPropertyName(PropertyNames.Id)] public string Id { get; set; } = null!; /// /// The sticker that represents the gift /// [JsonPropertyName(PropertyNames.Sticker)] public Sticker Sticker { get; set; } = null!; /// /// The number of Telegram Stars that must be paid to send the sticker /// [JsonPropertyName(PropertyNames.StarCount)] public int StarCount { get; set; } /// /// Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one /// [JsonPropertyName(PropertyNames.UpgradeStarCount)] public int? UpgradeStarCount { get; set; } /// /// Optional. True, if the gift can only be purchased by Telegram Premium subscribers /// [JsonPropertyName(PropertyNames.IsPremium)] public bool? IsPremium { get; set; } /// /// Optional. True, if the gift can be used (after being upgraded) to customize a user's appearance /// [JsonPropertyName(PropertyNames.HasColors)] public bool? HasColors { get; set; } /// /// Optional. The total number of gifts of this type that can be sent by all users; for limited gifts only /// [JsonPropertyName(PropertyNames.TotalCount)] public int? TotalCount { get; set; } /// /// Optional. The number of remaining gifts of this type that can be sent by all users; for limited gifts only /// [JsonPropertyName(PropertyNames.RemainingCount)] public int? RemainingCount { get; set; } /// /// Optional. The total number of gifts of this type that can be sent by the bot; for limited gifts only /// [JsonPropertyName(PropertyNames.PersonalTotalCount)] public int? PersonalTotalCount { get; set; } /// /// Optional. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only /// [JsonPropertyName(PropertyNames.PersonalRemainingCount)] public int? PersonalRemainingCount { get; set; } /// /// Optional. Background of the gift /// [JsonPropertyName(PropertyNames.Background)] public GiftBackground? Background { get; set; } /// /// Optional. The total number of different unique gifts that can be obtained by upgrading the gift /// [JsonPropertyName(PropertyNames.UniqueGiftVariantCount)] public int? UniqueGiftVariantCount { get; set; } /// /// Optional. Information about the chat that published the gift /// [JsonPropertyName(PropertyNames.PublisherChat)] public Chat? PublisherChat { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/GiftBackground.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the background of a gift. /// public class GiftBackground { /// /// Center color of the background in RGB format /// [JsonPropertyName(PropertyNames.CenterColor)] public int CenterColor { get; set; } /// /// Edge color of the background in RGB format /// [JsonPropertyName(PropertyNames.EdgeColor)] public int EdgeColor { get; set; } /// /// Text color of the background in RGB format /// [JsonPropertyName(PropertyNames.TextColor)] public int TextColor { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/GiftInfo.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about a regular gift that was sent or received. /// public class GiftInfo { /// /// Information about the gift /// [JsonPropertyName(PropertyNames.Gift)] public Gift Gift { get; set; } = null!; /// /// Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts /// [JsonPropertyName(PropertyNames.OwnedGiftId)] public string? OwnedGiftId { get; set; } /// /// Optional. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible /// [JsonPropertyName(PropertyNames.ConvertStarCount)] public int? ConvertStarCount { get; set; } /// /// Optional. Number of Telegram Stars that were prepaid for the ability to upgrade the gift /// [JsonPropertyName(PropertyNames.PrepaidUpgradeStarCount)] public int? PrepaidUpgradeStarCount { get; set; } /// /// Optional. True, if the gift's upgrade was purchased after the gift was sent /// [JsonPropertyName(PropertyNames.IsUpgradeSeparate)] public bool? IsUpgradeSeparate { get; set; } /// /// Optional. True, if the gift can be upgraded to a unique gift /// [JsonPropertyName(PropertyNames.CanBeUpgraded)] public bool? CanBeUpgraded { get; set; } /// /// Optional. Text of the message that was added to the gift /// [JsonPropertyName(PropertyNames.Text)] public string? Text { get; set; } /// /// Optional. Special entities that appear in the text /// [JsonPropertyName(PropertyNames.Entities)] public IEnumerable? Entities { get; set; } /// /// Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them /// [JsonPropertyName(PropertyNames.IsPrivate)] public bool? IsPrivate { get; set; } /// /// Optional. Unique number reserved for this gift when upgraded. See the number field in /// [JsonPropertyName(PropertyNames.UniqueGiftNumber)] public int? UniqueGiftNumber { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Gifts.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represent a list of gifts. /// public class Gifts { /// /// The list of gifts /// [JsonPropertyName(PropertyNames.Gifts)] public IEnumerable GiftList { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Giveaway.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a message about a scheduled giveaway. /// public class Giveaway { /// /// The list of chats which the user must join to participate in the giveaway /// [JsonPropertyName(PropertyNames.Chats)] public IEnumerable Chats { get; set; } = null!; /// /// Point in time (Unix timestamp) when winners of the giveaway will be selected /// [JsonPropertyName(PropertyNames.WinnersSelectionDate)] public int WinnersSelectionDate { get; set; } /// /// The number of users which are supposed to be selected as winners of the giveaway /// [JsonPropertyName(PropertyNames.WinnerCount)] public int WinnerCount { get; set; } /// /// Optional. True, if only users who join the chats after the giveaway started should be eligible to win /// [JsonPropertyName(PropertyNames.OnlyNewMembers)] public bool? OnlyNewMembers { get; set; } /// /// Optional. True, if the list of giveaway winners will be visible to everyone /// [JsonPropertyName(PropertyNames.HasPublicWinners)] public bool? HasPublicWinners { get; set; } /// /// Optional. Description of additional giveaway prize /// [JsonPropertyName(PropertyNames.PrizeDescription)] public string? PrizeDescription { get; set; } /// /// Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways. /// [JsonPropertyName(PropertyNames.CountryCodes)] public IEnumerable? CountryCodes { get; set; } /// /// Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only /// [JsonPropertyName(PropertyNames.PrizeStarCount)] public int? PrizeStarCount { get; set; } /// /// Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only /// [JsonPropertyName(PropertyNames.PremiumSubscriptionMonthCount)] public int? PremiumSubscriptionMonthCount { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/GiveawayCompleted.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a service message about the completion of a giveaway without public winners. /// public class GiveawayCompleted { /// /// Number of winners in the giveaway /// [JsonPropertyName(PropertyNames.WinnerCount)] public int WinnerCount { get; set; } /// /// Optional. Number of undistributed prizes /// [JsonPropertyName(PropertyNames.UnclaimedPrizeCount)] public int? UnclaimedPrizeCount { get; set; } /// /// Optional. Message with the giveaway that was completed, if it wasn't deleted /// [JsonPropertyName(PropertyNames.GiveawayMessage)] public Message? GiveawayMessage { get; set; } /// /// Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. /// [JsonPropertyName(PropertyNames.IsStarGiveaway)] public bool? IsStarGiveaway { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/GiveawayCreated.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a service message about the creation of a scheduled giveaway. /// public class GiveawayCreated { /// /// Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only /// [JsonPropertyName(PropertyNames.PrizeStarCount)] public int? PrizeStarCount { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/GiveawayWinners.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a message about the completion of a giveaway with public winners. /// public class GiveawayWinners { /// /// The chat that created the giveaway /// [JsonPropertyName(PropertyNames.Chat)] public Chat Chat { get; set; } = null!; /// /// Identifier of the message with the giveaway in the chat /// [JsonPropertyName(PropertyNames.GiveawayMessageId)] public int GiveawayMessageId { get; set; } /// /// Point in time (Unix timestamp) when winners of the giveaway were selected /// [JsonPropertyName(PropertyNames.WinnersSelectionDate)] public int WinnersSelectionDate { get; set; } /// /// Total number of winners in the giveaway /// [JsonPropertyName(PropertyNames.WinnerCount)] public int WinnerCount { get; set; } /// /// List of up to 100 winners of the giveaway /// [JsonPropertyName(PropertyNames.Winners)] public IEnumerable Winners { get; set; } = null!; /// /// Optional. The number of other chats the user had to join in order to be eligible for the giveaway /// [JsonPropertyName(PropertyNames.AdditionalChatCount)] public int? AdditionalChatCount { get; set; } /// /// Optional. The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only /// [JsonPropertyName(PropertyNames.PrizeStarCount)] public int? PrizeStarCount { get; set; } /// /// Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only /// [JsonPropertyName(PropertyNames.PremiumSubscriptionMonthCount)] public int? PremiumSubscriptionMonthCount { get; set; } /// /// Optional. Number of undistributed prizes /// [JsonPropertyName(PropertyNames.UnclaimedPrizeCount)] public int? UnclaimedPrizeCount { get; set; } /// /// Optional. True, if only users who had joined the chats after the giveaway started were eligible to win /// [JsonPropertyName(PropertyNames.OnlyNewMembers)] public bool? OnlyNewMembers { get; set; } /// /// Optional. True, if the giveaway was canceled because the payment for it was refunded /// [JsonPropertyName(PropertyNames.WasRefunded)] public bool? WasRefunded { get; set; } /// /// Optional. Description of additional giveaway prize /// [JsonPropertyName(PropertyNames.PrizeDescription)] public string? PrizeDescription { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InlineKeyboardButton.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Games; namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents one button of an inline keyboard. Exactly one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. /// public class InlineKeyboardButton { /// /// Initializes a new instance of the class. /// /// Label text on the button public InlineKeyboardButton(string text) { this.Text = text ?? throw new ArgumentNullException(nameof(text)); } /// /// Label text on the button /// [JsonPropertyName(PropertyNames.Text)] public string Text { get; set; } /// /// Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription. /// [JsonPropertyName(PropertyNames.IconCustomEmojiId)] public string? IconCustomEmojiId { get; set; } /// /// Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used. /// [JsonPropertyName(PropertyNames.Style)] public string? Style { get; set; } /// /// Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings. /// [JsonPropertyName(PropertyNames.Url)] public string? Url { get; set; } /// /// Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes /// [JsonPropertyName(PropertyNames.CallbackData)] public string? CallbackData { get; set; } /// /// Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account. /// [JsonPropertyName(PropertyNames.WebApp)] public WebAppInfo? WebApp { get; set; } /// /// Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. /// [JsonPropertyName(PropertyNames.LoginUrl)] public LoginUrl? LoginUrl { get; set; } /// /// Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent in channel direct messages chats and on behalf of a business account. /// [JsonPropertyName(PropertyNames.SwitchInlineQuery)] public string? SwitchInlineQuery { get; set; } /// /// Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.

This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a business account. ///
[JsonPropertyName(PropertyNames.SwitchInlineQueryCurrentChat)] public string? SwitchInlineQueryCurrentChat { get; set; } /// /// Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a business account. /// [JsonPropertyName(PropertyNames.SwitchInlineQueryChosenChat)] public SwitchInlineQueryChosenChat? SwitchInlineQueryChosenChat { get; set; } /// /// Optional. Description of the button that copies the specified text to the clipboard. /// [JsonPropertyName(PropertyNames.CopyText)] public CopyTextButton? CopyText { get; set; } /// /// Optional. Description of the game that will be launched when the user presses the button.

NOTE: This type of button must always be the first button in the first row. ///
[JsonPropertyName(PropertyNames.CallbackGame)] public CallbackGame? CallbackGame { get; set; } /// /// Optional. Specify True, to send a Pay button. Substrings “⭐” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.

NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. ///
[JsonPropertyName(PropertyNames.Pay)] public bool? Pay { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputChecklist.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a checklist to create. /// public class InputChecklist { /// /// Title of the checklist; 1-255 characters after entities parsing /// [JsonPropertyName(PropertyNames.Title)] public string Title { get; set; } = null!; /// /// Optional. Mode for parsing entities in the title. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// Optional. List of special entities that appear in the title, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are allowed. /// [JsonPropertyName(PropertyNames.TitleEntities)] public IEnumerable? TitleEntities { get; set; } /// /// List of 1-30 tasks in the checklist /// [JsonPropertyName(PropertyNames.Tasks)] public IEnumerable Tasks { get; set; } = null!; /// /// Optional. Pass True if other users can add tasks to the checklist /// [JsonPropertyName(PropertyNames.OthersCanAddTasks)] public bool? OthersCanAddTasks { get; set; } /// /// Optional. Pass True if other users can mark tasks as done or not done in the checklist /// [JsonPropertyName(PropertyNames.OthersCanMarkTasksAsDone)] public bool? OthersCanMarkTasksAsDone { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputChecklistTask.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a task to add to a checklist. /// public class InputChecklistTask { /// /// Unique identifier of the task; must be positive and unique among all task identifiers currently present in the checklist /// [JsonPropertyName(PropertyNames.Id)] public int Id { get; set; } /// /// Text of the task; 1-100 characters after entities parsing /// [JsonPropertyName(PropertyNames.Text)] public string Text { get; set; } = null!; /// /// Optional. Mode for parsing entities in the text. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// Optional. List of special entities that appear in the text, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are allowed. /// [JsonPropertyName(PropertyNames.TextEntities)] public IEnumerable? TextEntities { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputFile.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. using System.IO; using System.Net.Http; namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser. /// public sealed class InputFile : IEquatable { /// /// HTTP file content. /// [JsonIgnore] public StreamContent Content { get; private set; } /// /// File name. /// [JsonIgnore] public string Filename { get; private set; } /// New InputFile. /// HTTP file content. /// File name. public InputFile(StreamContent streamcontent, string filename) { this.Content = streamcontent; this.Filename = filename; } /// New InputFile. /// Stream file. /// File name. public InputFile(Stream stream, string filename) { this.Content = new StreamContent(stream); this.Filename = filename; } /// New InputFile. /// File. /// File name. public InputFile(byte[] file, string filename) { this.Content = new StreamContent(new MemoryStream(file)); this.Filename = filename; } /// public override bool Equals(object obj) { return this.Equals(obj as InputFile); } /// public bool Equals(InputFile? other) { return other != null && EqualityComparer.Default.Equals(this.Content, other.Content) && this.Filename == other.Filename; } /// public override int GetHashCode() { int hashCode = 1463301466; hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(this.Content); hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(this.Filename); return hashCode; } /// public static bool operator ==(InputFile? left, InputFile? right) { return EqualityComparer.Default.Equals(left!, right!); } /// public static bool operator !=(InputFile? left, InputFile? right) { return !(left == right); } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputMedia/InputMedia.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents the content of a media message to be sent. It should be one of /// /// /// /// /// /// /// /// /// /// /// /// [JsonConverter(typeof(InputMediaConverter))] public abstract class InputMedia { /// /// Type of the result /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputMedia/InputMediaAnimation.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent. /// public class InputMediaAnimation : InputMedia { /// /// Initializes a new instance of the class. /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » public InputMediaAnimation(string media) { this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Type of the result, must be animation /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "animation"; /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Media)] public string Media { get; set; } /// /// Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Thumbnail)] public string? Thumbnail { get; set; } /// /// Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Optional. Mode for parsing entities in the animation caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Optional. Pass True, if the caption must be shown above the message media /// [JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)] public bool? ShowCaptionAboveMedia { get; set; } /// /// Optional. Animation width /// [JsonPropertyName(PropertyNames.Width)] public int? Width { get; set; } /// /// Optional. Animation height /// [JsonPropertyName(PropertyNames.Height)] public int? Height { get; set; } /// /// Optional. Animation duration in seconds /// [JsonPropertyName(PropertyNames.Duration)] public int? Duration { get; set; } /// /// Optional. Pass True if the animation needs to be covered with a spoiler animation /// [JsonPropertyName(PropertyNames.HasSpoiler)] public bool? HasSpoiler { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputMedia/InputMediaAudio.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents an audio file to be treated as music to be sent. /// public class InputMediaAudio : InputMedia { /// /// Initializes a new instance of the class. /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » public InputMediaAudio(string media) { this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Type of the result, must be audio /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "audio"; /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Media)] public string Media { get; set; } /// /// Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Thumbnail)] public string? Thumbnail { get; set; } /// /// Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Optional. Mode for parsing entities in the audio caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Optional. Duration of the audio in seconds /// [JsonPropertyName(PropertyNames.Duration)] public int? Duration { get; set; } /// /// Optional. Performer of the audio /// [JsonPropertyName(PropertyNames.Performer)] public string? Performer { get; set; } /// /// Optional. Title of the audio /// [JsonPropertyName(PropertyNames.Title)] public string? Title { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputMedia/InputMediaDocument.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a general file to be sent. /// public class InputMediaDocument : InputMedia { /// /// Initializes a new instance of the class. /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » public InputMediaDocument(string media) { this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Type of the result, must be document /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "document"; /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Media)] public string Media { get; set; } /// /// Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Thumbnail)] public string? Thumbnail { get; set; } /// /// Optional. Caption of the document to be sent, 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Optional. Mode for parsing entities in the document caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album. /// [JsonPropertyName(PropertyNames.DisableContentTypeDetection)] public bool? DisableContentTypeDetection { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputMedia/InputMediaLivePhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a live photo to be sent. /// public class InputMediaLivePhoto : InputMedia { /// /// Initializes a new instance of the class. /// /// Video of the live photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// The static photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files ». Sending live photos by a URL is currently unsupported. public InputMediaLivePhoto(string media, string photo) { this.Media = media ?? throw new ArgumentNullException(nameof(media)); this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Type of the result, must be live_photo /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "live_photo"; /// /// Video of the live photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// [JsonPropertyName(PropertyNames.Media)] public string Media { get; set; } /// /// The static photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// [JsonPropertyName(PropertyNames.Photo)] public string Photo { get; set; } /// /// Optional. Caption of the live photo to be sent, 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Optional. Mode for parsing entities in the live photo caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Optional. Pass True, if the caption must be shown above the message media /// [JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)] public bool? ShowCaptionAboveMedia { get; set; } /// /// Optional. Pass True if the live photo needs to be covered with a spoiler animation /// [JsonPropertyName(PropertyNames.HasSpoiler)] public bool? HasSpoiler { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputMedia/InputMediaLocation.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a location to be sent. /// public class InputMediaLocation : InputMedia { /// /// Initializes a new instance of the class. /// /// Latitude of the location /// Longitude of the location public InputMediaLocation(float latitude, float longitude) { this.Latitude = latitude; this.Longitude = longitude; } /// /// Type of the result, must be location /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "location"; /// /// Latitude of the location /// [JsonPropertyName(PropertyNames.Latitude)] public float Latitude { get; set; } /// /// Longitude of the location /// [JsonPropertyName(PropertyNames.Longitude)] public float Longitude { get; set; } /// /// Optional. The radius of uncertainty for the location, measured in meters; 0-1500 /// [JsonPropertyName(PropertyNames.HorizontalAccuracy)] public float? HorizontalAccuracy { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputMedia/InputMediaPhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a photo to be sent. /// public class InputMediaPhoto : InputMedia { /// /// Initializes a new instance of the class. /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » public InputMediaPhoto(string media) { this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Type of the result, must be photo /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "photo"; /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Media)] public string Media { get; set; } /// /// Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Optional. Mode for parsing entities in the photo caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Optional. Pass True, if the caption must be shown above the message media /// [JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)] public bool? ShowCaptionAboveMedia { get; set; } /// /// Optional. Pass True if the photo needs to be covered with a spoiler animation /// [JsonPropertyName(PropertyNames.HasSpoiler)] public bool? HasSpoiler { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputMedia/InputMediaSticker.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a sticker file to be sent. /// public class InputMediaSticker : InputMedia { /// /// Initializes a new instance of the class. /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a .WEBP sticker from the Internet, or pass “attach://<file_attach_name>” to upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data under <file_attach_name> name. More information on Sending Files » public InputMediaSticker(string media) { this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Type of the result, must be sticker /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "sticker"; /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a .WEBP sticker from the Internet, or pass “attach://<file_attach_name>” to upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Media)] public string Media { get; set; } /// /// Optional. Emoji associated with the sticker; only for just uploaded stickers /// [JsonPropertyName(PropertyNames.Emoji)] public string? Emoji { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputMedia/InputMediaVenue.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a venue to be sent. /// public class InputMediaVenue : InputMedia { /// /// Initializes a new instance of the class. /// /// Latitude of the location /// Longitude of the location /// Name of the venue /// Address of the venue public InputMediaVenue(float latitude, float longitude, string title, string address) { this.Latitude = latitude; this.Longitude = longitude; this.Title = title ?? throw new ArgumentNullException(nameof(title)); this.Address = address ?? throw new ArgumentNullException(nameof(address)); } /// /// Type of the result, must be venue /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "venue"; /// /// Latitude of the location /// [JsonPropertyName(PropertyNames.Latitude)] public float Latitude { get; set; } /// /// Longitude of the location /// [JsonPropertyName(PropertyNames.Longitude)] public float Longitude { get; set; } /// /// Name of the venue /// [JsonPropertyName(PropertyNames.Title)] public string Title { get; set; } /// /// Address of the venue /// [JsonPropertyName(PropertyNames.Address)] public string Address { get; set; } /// /// Optional. Foursquare identifier of the venue /// [JsonPropertyName(PropertyNames.FoursquareId)] public string? FoursquareId { get; set; } /// /// Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) /// [JsonPropertyName(PropertyNames.FoursquareType)] public string? FoursquareType { get; set; } /// /// Optional. Google Places identifier of the venue /// [JsonPropertyName(PropertyNames.GooglePlaceId)] public string? GooglePlaceId { get; set; } /// /// Optional. Google Places type of the venue. (See supported types.) /// [JsonPropertyName(PropertyNames.GooglePlaceType)] public string? GooglePlaceType { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputMedia/InputMediaVideo.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a video to be sent. /// public class InputMediaVideo : InputMedia { /// /// Initializes a new instance of the class. /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » public InputMediaVideo(string media) { this.Media = media ?? throw new ArgumentNullException(nameof(media)); } /// /// Type of the result, must be video /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "video"; /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Media)] public string Media { get; set; } /// /// Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Thumbnail)] public string? Thumbnail { get; set; } /// /// Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Cover)] public string? Cover { get; set; } /// /// Optional. Start timestamp for the video in the message /// [JsonPropertyName(PropertyNames.StartTimestamp)] public int? StartTimestamp { get; set; } /// /// Optional. Caption of the video to be sent, 0-1024 characters after entities parsing /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Optional. Mode for parsing entities in the video caption. See formatting options for more details. /// [JsonPropertyName(PropertyNames.ParseMode)] public string? ParseMode { get; set; } /// /// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Optional. Pass True, if the caption must be shown above the message media /// [JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)] public bool? ShowCaptionAboveMedia { get; set; } /// /// Optional. Video width /// [JsonPropertyName(PropertyNames.Width)] public int? Width { get; set; } /// /// Optional. Video height /// [JsonPropertyName(PropertyNames.Height)] public int? Height { get; set; } /// /// Optional. Video duration in seconds /// [JsonPropertyName(PropertyNames.Duration)] public int? Duration { get; set; } /// /// Optional. Pass True if the uploaded video is suitable for streaming /// [JsonPropertyName(PropertyNames.SupportsStreaming)] public bool? SupportsStreaming { get; set; } /// /// Optional. Pass True if the video needs to be covered with a spoiler animation /// [JsonPropertyName(PropertyNames.HasSpoiler)] public bool? HasSpoiler { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputPaidMedia/InputPaidMedia.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the paid media to be sent. Currently, it can be one of /// /// /// /// /// /// [JsonConverter(typeof(InputPaidMediaConverter))] public abstract class InputPaidMedia { /// /// Type of the media /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } /// /// No description available /// [JsonPropertyName(PropertyNames.Media)] public abstract string Media { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputPaidMedia/InputPaidMediaLivePhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The paid media to send is a live photo. /// public class InputPaidMediaLivePhoto : InputPaidMedia { /// /// Type of the media, must be live_photo /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "live_photo"; /// /// Video of the live photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// [JsonPropertyName(PropertyNames.Media)] public override string Media { get; set; } = null!; /// /// The static photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files ». Sending live photos by a URL is currently unsupported. /// [JsonPropertyName(PropertyNames.Photo)] public string Photo { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputPaidMedia/InputPaidMediaPhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The paid media to send is a photo. /// public class InputPaidMediaPhoto : InputPaidMedia { /// /// Type of the media, must be photo /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "photo"; /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Media)] public override string Media { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputPaidMedia/InputPaidMediaVideo.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The paid media to send is a video. /// public class InputPaidMediaVideo : InputPaidMedia { /// /// Type of the media, must be video /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "video"; /// /// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Media)] public override string Media { get; set; } = null!; /// /// Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Thumbnail)] public string? Thumbnail { get; set; } /// /// Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Cover)] public string? Cover { get; set; } /// /// Optional. Start timestamp for the video in the message /// [JsonPropertyName(PropertyNames.StartTimestamp)] public int? StartTimestamp { get; set; } /// /// Optional. Video width /// [JsonPropertyName(PropertyNames.Width)] public int? Width { get; set; } /// /// Optional. Video height /// [JsonPropertyName(PropertyNames.Height)] public int? Height { get; set; } /// /// Optional. Video duration in seconds /// [JsonPropertyName(PropertyNames.Duration)] public int? Duration { get; set; } /// /// Optional. Pass True if the uploaded video is suitable for streaming /// [JsonPropertyName(PropertyNames.SupportsStreaming)] public bool? SupportsStreaming { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputPollOption.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using InputPollOptionMedia = Telegram.BotAPI.AvailableTypes.InputMedia; namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains information about one answer option in a poll to be sent. /// public class InputPollOption { /// /// Initializes a new instance of the class. /// /// Option text, 1-100 characters public InputPollOption(string text) { this.Text = text ?? throw new ArgumentNullException(nameof(text)); } /// /// Option text, 1-100 characters /// [JsonPropertyName(PropertyNames.Text)] public string Text { get; set; } /// /// Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed /// [JsonPropertyName(PropertyNames.TextParseMode)] public string? TextParseMode { get; set; } /// /// Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode /// [JsonPropertyName(PropertyNames.TextEntities)] public IEnumerable? TextEntities { get; set; } /// /// Optional. Media added to the poll option /// [JsonPropertyName(PropertyNames.Media)] public InputPollOptionMedia? Media { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputProfilePhoto/InputProfilePhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes a profile photo to set. Currently, it can be one of /// /// /// /// /// [JsonConverter(typeof(InputProfilePhotoConverter))] public abstract class InputProfilePhoto { /// /// Type of the profile photo /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputProfilePhoto/InputProfilePhotoAnimated.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// An animated profile photo in the MPEG4 format. /// public class InputProfilePhotoAnimated : InputProfilePhoto { /// /// Initializes a new instance of the class. /// /// The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » public InputProfilePhotoAnimated(string animation) { this.Animation = animation ?? throw new ArgumentNullException(nameof(animation)); } /// /// Type of the profile photo, must be animated /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "animated"; /// /// The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Animation)] public string Animation { get; set; } /// /// Optional. Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0. /// [JsonPropertyName(PropertyNames.MainFrameTimestamp)] public float? MainFrameTimestamp { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputProfilePhoto/InputProfilePhotoStatic.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// A static profile photo in the .JPG format. /// public class InputProfilePhotoStatic : InputProfilePhoto { /// /// Initializes a new instance of the class. /// /// The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » public InputProfilePhotoStatic(string photo) { this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Type of the profile photo, must be static /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "static"; /// /// The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Photo)] public string Photo { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputStoryContent/InputStoryContent.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the content of a story to post. Currently, it can be one of /// /// /// /// /// [JsonConverter(typeof(InputStoryContentConverter))] public abstract class InputStoryContent { /// /// Type of the content /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputStoryContent/InputStoryContentPhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a photo to post as a story. /// public class InputStoryContentPhoto : InputStoryContent { /// /// Initializes a new instance of the class. /// /// The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » public InputStoryContentPhoto(string photo) { this.Photo = photo ?? throw new ArgumentNullException(nameof(photo)); } /// /// Type of the content, must be photo /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "photo"; /// /// The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Photo)] public string Photo { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/InputStoryContent/InputStoryContentVideo.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a video to post as a story. /// public class InputStoryContentVideo : InputStoryContent { /// /// Initializes a new instance of the class. /// /// The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the video was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » public InputStoryContentVideo(string video) { this.Video = video ?? throw new ArgumentNullException(nameof(video)); } /// /// Type of the content, must be video /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "video"; /// /// The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the video was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » /// [JsonPropertyName(PropertyNames.Video)] public string Video { get; set; } /// /// Optional. Precise duration of the video in seconds; 0-60 /// [JsonPropertyName(PropertyNames.Duration)] public float? Duration { get; set; } /// /// Optional. Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0. /// [JsonPropertyName(PropertyNames.CoverFrameTimestamp)] public float? CoverFrameTimestamp { get; set; } /// /// Optional. Pass True if the video has no sound /// [JsonPropertyName(PropertyNames.IsAnimation)] public bool? IsAnimation { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/KeyboardButton.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents one button of the reply keyboard. At most one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. For simple text buttons, String can be used instead of this object to specify the button text. /// public class KeyboardButton { /// /// Initializes a new instance of the class. /// /// Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed public KeyboardButton(string text) { this.Text = text ?? throw new ArgumentNullException(nameof(text)); } /// /// Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed /// [JsonPropertyName(PropertyNames.Text)] public string Text { get; set; } /// /// Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription. /// [JsonPropertyName(PropertyNames.IconCustomEmojiId)] public string? IconCustomEmojiId { get; set; } /// /// Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used. /// [JsonPropertyName(PropertyNames.Style)] public string? Style { get; set; } /// /// Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only. /// [JsonPropertyName(PropertyNames.RequestUsers)] public KeyboardButtonRequestUsers? RequestUsers { get; set; } /// /// Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only. /// [JsonPropertyName(PropertyNames.RequestChat)] public KeyboardButtonRequestChat? RequestChat { get; set; } /// /// Optional. If specified, pressing the button will ask the user to create and share a bot that will be managed by the current bot. Available for bots that enabled management of other bots in the @BotFather Mini App. Available in private chats only. /// [JsonPropertyName(PropertyNames.RequestManagedBot)] public KeyboardButtonRequestManagedBot? RequestManagedBot { get; set; } /// /// Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. /// [JsonPropertyName(PropertyNames.RequestContact)] public bool? RequestContact { get; set; } /// /// Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only. /// [JsonPropertyName(PropertyNames.RequestLocation)] public bool? RequestLocation { get; set; } /// /// Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only. /// [JsonPropertyName(PropertyNames.RequestPoll)] public KeyboardButtonPollType? RequestPoll { get; set; } /// /// Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only. /// [JsonPropertyName(PropertyNames.WebApp)] public WebAppInfo? WebApp { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/KeyboardButtonPollType.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. /// public class KeyboardButtonPollType { /// /// Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type. /// [JsonPropertyName(PropertyNames.Type)] public string? Type { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/KeyboardButtonRequestChat.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. More about requesting chats ». /// public class KeyboardButtonRequestChat { /// /// Initializes a new instance of the class. /// /// Signed 32-bit identifier of the request, which will be received back in the object. Must be unique within the message /// Pass True to request a channel chat, pass False to request a group or a supergroup chat. public KeyboardButtonRequestChat(int requestId, bool chatIsChannel) { this.RequestId = requestId; this.ChatIsChannel = chatIsChannel; } /// /// Signed 32-bit identifier of the request, which will be received back in the object. Must be unique within the message /// [JsonPropertyName(PropertyNames.RequestId)] public int RequestId { get; set; } /// /// Pass True to request a channel chat, pass False to request a group or a supergroup chat. /// [JsonPropertyName(PropertyNames.ChatIsChannel)] public bool ChatIsChannel { get; set; } /// /// Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied. /// [JsonPropertyName(PropertyNames.ChatIsForum)] public bool? ChatIsForum { get; set; } /// /// Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied. /// [JsonPropertyName(PropertyNames.ChatHasUsername)] public bool? ChatHasUsername { get; set; } /// /// Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied. /// [JsonPropertyName(PropertyNames.ChatIsCreated)] public bool? ChatIsCreated { get; set; } /// /// Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied. /// [JsonPropertyName(PropertyNames.UserAdministratorRights)] public ChatAdministratorRights? UserAdministratorRights { get; set; } /// /// Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied. /// [JsonPropertyName(PropertyNames.BotAdministratorRights)] public ChatAdministratorRights? BotAdministratorRights { get; set; } /// /// Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. /// [JsonPropertyName(PropertyNames.BotIsMember)] public bool? BotIsMember { get; set; } /// /// Optional. Pass True to request the chat's title /// [JsonPropertyName(PropertyNames.RequestTitle)] public bool? RequestTitle { get; set; } /// /// Optional. Pass True to request the chat's username /// [JsonPropertyName(PropertyNames.RequestUsername)] public bool? RequestUsername { get; set; } /// /// Optional. Pass True to request the chat's photo /// [JsonPropertyName(PropertyNames.RequestPhoto)] public bool? RequestPhoto { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/KeyboardButtonRequestManagedBot.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object defines the parameters for the creation of a managed bot. Information about the created bot will be shared with the bot using the update managed_bot and a with the field managed_bot_created. /// public class KeyboardButtonRequestManagedBot { /// /// Signed 32-bit identifier of the request. Must be unique within the message /// [JsonPropertyName(PropertyNames.RequestId)] public int RequestId { get; set; } /// /// Optional. Suggested name for the bot /// [JsonPropertyName(PropertyNames.SuggestedName)] public string? SuggestedName { get; set; } /// /// Optional. Suggested username for the bot /// [JsonPropertyName(PropertyNames.SuggestedUsername)] public string? SuggestedUsername { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/KeyboardButtonRequestUsers.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users » /// public class KeyboardButtonRequestUsers { /// /// Initializes a new instance of the class. /// /// Signed 32-bit identifier of the request that will be received back in the object. Must be unique within the message public KeyboardButtonRequestUsers(int requestId) { this.RequestId = requestId; } /// /// Signed 32-bit identifier of the request that will be received back in the object. Must be unique within the message /// [JsonPropertyName(PropertyNames.RequestId)] public int RequestId { get; set; } /// /// Optional. Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied. /// [JsonPropertyName(PropertyNames.UserIsBot)] public bool? UserIsBot { get; set; } /// /// Optional. Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied. /// [JsonPropertyName(PropertyNames.UserIsPremium)] public bool? UserIsPremium { get; set; } /// /// Optional. The maximum number of users to be selected; 1-10. Defaults to 1. /// [JsonPropertyName(PropertyNames.MaxQuantity)] public int? MaxQuantity { get; set; } /// /// Optional. Pass True to request the users' first and last names /// [JsonPropertyName(PropertyNames.RequestName)] public bool? RequestName { get; set; } /// /// Optional. Pass True to request the users' usernames /// [JsonPropertyName(PropertyNames.RequestUsername)] public bool? RequestUsername { get; set; } /// /// Optional. Pass True to request the users' photos /// [JsonPropertyName(PropertyNames.RequestPhoto)] public bool? RequestPhoto { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/LinkPreviewOptions.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes the options used for link preview generation. /// public class LinkPreviewOptions { /// /// Optional. True, if the link preview is disabled /// [JsonPropertyName(PropertyNames.IsDisabled)] public bool? IsDisabled { get; set; } /// /// Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used /// [JsonPropertyName(PropertyNames.Url)] public string? Url { get; set; } /// /// Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview /// [JsonPropertyName(PropertyNames.PreferSmallMedia)] public bool? PreferSmallMedia { get; set; } /// /// Optional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview /// [JsonPropertyName(PropertyNames.PreferLargeMedia)] public bool? PreferLargeMedia { get; set; } /// /// Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text /// [JsonPropertyName(PropertyNames.ShowAboveText)] public bool? ShowAboveText { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/LivePhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a live photo. /// public class LivePhoto { /// /// Optional. Available sizes of the corresponding static photo /// [JsonPropertyName(PropertyNames.Photo)] public IEnumerable? Photo { get; set; } /// /// Identifier for the video file which can be used to download or reuse the file /// [JsonPropertyName(PropertyNames.FileId)] public string FileId { get; set; } = null!; /// /// Unique identifier for the video file which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. /// [JsonPropertyName(PropertyNames.FileUniqueId)] public string FileUniqueId { get; set; } = null!; /// /// Video width as defined by the sender /// [JsonPropertyName(PropertyNames.Width)] public int Width { get; set; } /// /// Video height as defined by the sender /// [JsonPropertyName(PropertyNames.Height)] public int Height { get; set; } /// /// Duration of the video in seconds as defined by the sender /// [JsonPropertyName(PropertyNames.Duration)] public int Duration { get; set; } /// /// Optional. MIME type of the file as defined by the sender /// [JsonPropertyName(PropertyNames.MimeType)] public string? MimeType { get; set; } /// /// Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. /// [JsonPropertyName(PropertyNames.FileSize)] public long? FileSize { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Location.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a point on the map. /// public class Location { /// /// Latitude as defined by the sender /// [JsonPropertyName(PropertyNames.Latitude)] public float Latitude { get; set; } /// /// Longitude as defined by the sender /// [JsonPropertyName(PropertyNames.Longitude)] public float Longitude { get; set; } /// /// Optional. The radius of uncertainty for the location, measured in meters; 0-1500 /// [JsonPropertyName(PropertyNames.HorizontalAccuracy)] public float? HorizontalAccuracy { get; set; } /// /// Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. /// [JsonPropertyName(PropertyNames.LivePeriod)] public int? LivePeriod { get; set; } /// /// Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. /// [JsonPropertyName(PropertyNames.Heading)] public int? Heading { get; set; } /// /// Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. /// [JsonPropertyName(PropertyNames.ProximityAlertRadius)] public int? ProximityAlertRadius { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/LocationAddress.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes the physical address of a location. /// public class LocationAddress { /// /// The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located /// [JsonPropertyName(PropertyNames.CountryCode)] public string CountryCode { get; set; } = null!; /// /// Optional. State of the location /// [JsonPropertyName(PropertyNames.State)] public string? State { get; set; } /// /// Optional. City of the location /// [JsonPropertyName(PropertyNames.City)] public string? City { get; set; } /// /// Optional. Street address of the location /// [JsonPropertyName(PropertyNames.Street)] public string? Street { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/LoginUrl.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in: /// Telegram apps support these buttons as of version 5.7. /// public class LoginUrl { /// /// Initializes a new instance of the class. /// /// An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.

NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization. public LoginUrl(string url) { this.Url = url ?? throw new ArgumentNullException(nameof(url)); } /// /// An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.

NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization. ///
[JsonPropertyName(PropertyNames.Url)] public string Url { get; set; } /// /// Optional. New text of the button in forwarded messages. /// [JsonPropertyName(PropertyNames.ForwardText)] public string? ForwardText { get; set; } /// /// Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. /// [JsonPropertyName(PropertyNames.BotUsername)] public string? BotUsername { get; set; } /// /// Optional. Pass True to request the permission for your bot to send messages to the user. /// [JsonPropertyName(PropertyNames.RequestWriteAccess)] public bool? RequestWriteAccess { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ManagedBotCreated.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains information about the bot that was created to be managed by the current bot. /// public class ManagedBotCreated { /// /// Information about the bot. The bot's token can be fetched using the method getManagedBotToken. /// [JsonPropertyName(PropertyNames.Bot)] public User Bot { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ManagedBotUpdated.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains information about the creation, token update, or owner update of a bot that is managed by the current bot. /// public class ManagedBotUpdated { /// /// User that created the bot /// [JsonPropertyName(PropertyNames.User)] public User User { get; set; } = null!; /// /// Information about the bot. Token of the bot can be fetched using the method getManagedBotToken. /// [JsonPropertyName(PropertyNames.Bot)] public User Bot { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MaybeInaccessibleMessage/InaccessibleMessage.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes a message that was deleted or is otherwise inaccessible to the bot. /// public class InaccessibleMessage : MaybeInaccessibleMessage { /// /// Chat the message belonged to /// [JsonPropertyName(PropertyNames.Chat)] public override Chat Chat { get; set; } = null!; /// /// Unique message identifier inside the chat /// [JsonPropertyName(PropertyNames.MessageId)] public override int MessageId { get; set; } /// /// Always 0. The field can be used to differentiate regular and inaccessible messages. /// [JsonPropertyName(PropertyNames.Date)] public override int Date { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MaybeInaccessibleMessage/MaybeInaccessibleMessage.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes a message that can be inaccessible to the bot. It can be one of /// /// /// /// /// [JsonConverter(typeof(MaybeInaccessibleMessageConverter))] public abstract class MaybeInaccessibleMessage { /// /// No description available /// [JsonPropertyName(PropertyNames.MessageId)] public abstract int MessageId { get; set; } /// /// No description available /// [JsonPropertyName(PropertyNames.Date)] public abstract int Date { get; set; } /// /// No description available /// [JsonPropertyName(PropertyNames.Chat)] public abstract Chat Chat { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MaybeInaccessibleMessage/Message.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Games; using Telegram.BotAPI.Payments; using Telegram.BotAPI.Stickers; using Telegram.BotAPI.TelegramPassport; namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a message. /// public class Message : MaybeInaccessibleMessage { /// /// Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent /// [JsonPropertyName(PropertyNames.MessageId)] public override int MessageId { get; set; } /// /// Optional. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only /// [JsonPropertyName(PropertyNames.MessageThreadId)] public int? MessageThreadId { get; set; } /// /// Optional. Information about the direct messages chat topic that contains the message /// [JsonPropertyName(PropertyNames.DirectMessagesTopic)] public DirectMessagesTopic? DirectMessagesTopic { get; set; } /// /// Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats /// [JsonPropertyName(PropertyNames.From)] public User? From { get; set; } /// /// Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats. /// [JsonPropertyName(PropertyNames.SenderChat)] public Chat? SenderChat { get; set; } /// /// Optional. If the sender of the message boosted the chat, the number of boosts added by the user /// [JsonPropertyName(PropertyNames.SenderBoostCount)] public int? SenderBoostCount { get; set; } /// /// Optional. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account. /// [JsonPropertyName(PropertyNames.SenderBusinessBot)] public User? SenderBusinessBot { get; set; } /// /// Optional. Tag or custom title of the sender of the message; for supergroups only /// [JsonPropertyName(PropertyNames.SenderTag)] public string? SenderTag { get; set; } /// /// Date the message was sent in Unix time. It is always a positive number, representing a valid date. /// [JsonPropertyName(PropertyNames.Date)] public override int Date { get; set; } /// /// Optional. The unique identifier for the guest query. Use this identifier with the method answerGuestQuery to send a response message. If non-empty, the message belongs to the chat where the guest bot was summoned, which may not coincide with other existing bot chats sharing the same identifier. /// [JsonPropertyName(PropertyNames.GuestQueryId)] public string? GuestQueryId { get; set; } /// /// Optional. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier. /// [JsonPropertyName(PropertyNames.BusinessConnectionId)] public string? BusinessConnectionId { get; set; } /// /// Chat the message belongs to /// [JsonPropertyName(PropertyNames.Chat)] public override Chat Chat { get; set; } = null!; /// /// Optional. Information about the original message for forwarded messages /// [JsonPropertyName(PropertyNames.ForwardOrigin)] public MessageOrigin? ForwardOrigin { get; set; } /// /// Optional. True, if the message is sent to a topic in a forum supergroup or a private chat with the bot /// [JsonPropertyName(PropertyNames.IsTopicMessage)] public bool? IsTopicMessage { get; set; } /// /// Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group /// [JsonPropertyName(PropertyNames.IsAutomaticForward)] public bool? IsAutomaticForward { get; set; } /// /// Optional. For replies in the same chat and message thread, the original message. Note that the object in this field will not contain further reply_to_message fields even if it itself is a reply. /// [JsonPropertyName(PropertyNames.ReplyToMessage)] public Message? ReplyToMessage { get; set; } /// /// Optional. Information about the message that is being replied to, which may come from another chat or forum topic /// [JsonPropertyName(PropertyNames.ExternalReply)] public ExternalReplyInfo? ExternalReply { get; set; } /// /// Optional. For replies that quote part of the original message, the quoted part of the message /// [JsonPropertyName(PropertyNames.Quote)] public TextQuote? Quote { get; set; } /// /// Optional. For replies to a story, the original story /// [JsonPropertyName(PropertyNames.ReplyToStory)] public Story? ReplyToStory { get; set; } /// /// Optional. Identifier of the specific checklist task that is being replied to /// [JsonPropertyName(PropertyNames.ReplyToChecklistTaskId)] public int? ReplyToChecklistTaskId { get; set; } /// /// Optional. Persistent identifier of the specific poll option that is being replied to /// [JsonPropertyName(PropertyNames.ReplyToPollOptionId)] public string? ReplyToPollOptionId { get; set; } /// /// Optional. Bot through which the message was sent /// [JsonPropertyName(PropertyNames.ViaBot)] public User? ViaBot { get; set; } /// /// Optional. For a message sent by a guest bot, this is the user whose original message triggered the bot's response /// [JsonPropertyName(PropertyNames.GuestBotCallerUser)] public User? GuestBotCallerUser { get; set; } /// /// Optional. For a message sent by a guest bot, this is the chat whose original message triggered the bot's response /// [JsonPropertyName(PropertyNames.GuestBotCallerChat)] public Chat? GuestBotCallerChat { get; set; } /// /// Optional. Date the message was last edited in Unix time /// [JsonPropertyName(PropertyNames.EditDate)] public int? EditDate { get; set; } /// /// Optional. True, if the message can't be forwarded /// [JsonPropertyName(PropertyNames.HasProtectedContent)] public bool? HasProtectedContent { get; set; } /// /// Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message /// [JsonPropertyName(PropertyNames.IsFromOffline)] public bool? IsFromOffline { get; set; } /// /// Optional. True, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can't be edited. /// [JsonPropertyName(PropertyNames.IsPaidPost)] public bool? IsPaidPost { get; set; } /// /// Optional. The unique identifier inside this chat of a media message group this message belongs to /// [JsonPropertyName(PropertyNames.MediaGroupId)] public string? MediaGroupId { get; set; } /// /// Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator /// [JsonPropertyName(PropertyNames.AuthorSignature)] public string? AuthorSignature { get; set; } /// /// Optional. The number of Telegram Stars that were paid by the sender of the message to send it /// [JsonPropertyName(PropertyNames.PaidStarCount)] public int? PaidStarCount { get; set; } /// /// Optional. For text messages, the actual UTF-8 text of the message /// [JsonPropertyName(PropertyNames.Text)] public string? Text { get; set; } /// /// Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text /// [JsonPropertyName(PropertyNames.Entities)] public IEnumerable? Entities { get; set; } /// /// Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed /// [JsonPropertyName(PropertyNames.LinkPreviewOptions)] public LinkPreviewOptions? LinkPreviewOptions { get; set; } /// /// Optional. Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can't be edited. /// [JsonPropertyName(PropertyNames.SuggestedPostInfo)] public SuggestedPostInfo? SuggestedPostInfo { get; set; } /// /// Optional. Unique identifier of the message effect added to the message /// [JsonPropertyName(PropertyNames.EffectId)] public string? EffectId { get; set; } /// /// Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set /// [JsonPropertyName(PropertyNames.Animation)] public Animation? Animation { get; set; } /// /// Optional. Message is an audio file, information about the file /// [JsonPropertyName(PropertyNames.Audio)] public Audio? Audio { get; set; } /// /// Optional. Message is a general file, information about the file /// [JsonPropertyName(PropertyNames.Document)] public Document? Document { get; set; } /// /// Optional. Message is a live photo, information about the live photo. For backward compatibility, when this field is set, the photo field will also be set /// [JsonPropertyName(PropertyNames.LivePhoto)] public LivePhoto? LivePhoto { get; set; } /// /// Optional. Message contains paid media; information about the paid media /// [JsonPropertyName(PropertyNames.PaidMedia)] public PaidMediaInfo? PaidMedia { get; set; } /// /// Optional. Message is a photo, available sizes of the photo /// [JsonPropertyName(PropertyNames.Photo)] public IEnumerable? Photo { get; set; } /// /// Optional. Message is a sticker, information about the sticker /// [JsonPropertyName(PropertyNames.Sticker)] public Sticker? Sticker { get; set; } /// /// Optional. Message is a forwarded story /// [JsonPropertyName(PropertyNames.Story)] public Story? Story { get; set; } /// /// Optional. Message is a video, information about the video /// [JsonPropertyName(PropertyNames.Video)] public Video? Video { get; set; } /// /// Optional. Message is a video note, information about the video message /// [JsonPropertyName(PropertyNames.VideoNote)] public VideoNote? VideoNote { get; set; } /// /// Optional. Message is a voice message, information about the file /// [JsonPropertyName(PropertyNames.Voice)] public Voice? Voice { get; set; } /// /// Optional. Caption for the animation, audio, document, paid media, photo, video or voice /// [JsonPropertyName(PropertyNames.Caption)] public string? Caption { get; set; } /// /// Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption /// [JsonPropertyName(PropertyNames.CaptionEntities)] public IEnumerable? CaptionEntities { get; set; } /// /// Optional. True, if the caption must be shown above the message media /// [JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)] public bool? ShowCaptionAboveMedia { get; set; } /// /// Optional. True, if the message media is covered by a spoiler animation /// [JsonPropertyName(PropertyNames.HasMediaSpoiler)] public bool? HasMediaSpoiler { get; set; } /// /// Optional. Message is a checklist /// [JsonPropertyName(PropertyNames.Checklist)] public Checklist? Checklist { get; set; } /// /// Optional. Message is a shared contact, information about the contact /// [JsonPropertyName(PropertyNames.Contact)] public Contact? Contact { get; set; } /// /// Optional. Message is a dice with random value /// [JsonPropertyName(PropertyNames.Dice)] public Dice? Dice { get; set; } /// /// Optional. Message is a game, information about the game. More about games » /// [JsonPropertyName(PropertyNames.Game)] public Game? Game { get; set; } /// /// Optional. Message is a native poll, information about the poll /// [JsonPropertyName(PropertyNames.Poll)] public Poll? Poll { get; set; } /// /// Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set /// [JsonPropertyName(PropertyNames.Venue)] public Venue? Venue { get; set; } /// /// Optional. Message is a shared location, information about the location /// [JsonPropertyName(PropertyNames.Location)] public Location? Location { get; set; } /// /// Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) /// [JsonPropertyName(PropertyNames.NewChatMembers)] public IEnumerable? NewChatMembers { get; set; } /// /// Optional. A member was removed from the group, information about them (this member may be the bot itself) /// [JsonPropertyName(PropertyNames.LeftChatMember)] public User? LeftChatMember { get; set; } /// /// Optional. Service message: chat owner has left /// [JsonPropertyName(PropertyNames.ChatOwnerLeft)] public ChatOwnerLeft? ChatOwnerLeft { get; set; } /// /// Optional. Service message: chat owner has changed /// [JsonPropertyName(PropertyNames.ChatOwnerChanged)] public ChatOwnerChanged? ChatOwnerChanged { get; set; } /// /// Optional. A chat title was changed to this value /// [JsonPropertyName(PropertyNames.NewChatTitle)] public string? NewChatTitle { get; set; } /// /// Optional. A chat photo was change to this value /// [JsonPropertyName(PropertyNames.NewChatPhoto)] public IEnumerable? NewChatPhoto { get; set; } /// /// Optional. Service message: the chat photo was deleted /// [JsonPropertyName(PropertyNames.DeleteChatPhoto)] public bool? DeleteChatPhoto { get; set; } /// /// Optional. Service message: the group has been created /// [JsonPropertyName(PropertyNames.GroupChatCreated)] public bool? GroupChatCreated { get; set; } /// /// Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. /// [JsonPropertyName(PropertyNames.SupergroupChatCreated)] public bool? SupergroupChatCreated { get; set; } /// /// Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. /// [JsonPropertyName(PropertyNames.ChannelChatCreated)] public bool? ChannelChatCreated { get; set; } /// /// Optional. Service message: auto-delete timer settings changed in the chat /// [JsonPropertyName(PropertyNames.MessageAutoDeleteTimerChanged)] public MessageAutoDeleteTimerChanged? MessageAutoDeleteTimerChanged { get; set; } /// /// Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. /// [JsonPropertyName(PropertyNames.MigrateToChatId)] public long? MigrateToChatId { get; set; } /// /// Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. /// [JsonPropertyName(PropertyNames.MigrateFromChatId)] public long? MigrateFromChatId { get; set; } /// /// Optional. Specified message was pinned. Note that the object in this field will not contain further reply_to_message fields even if it itself is a reply. /// [JsonPropertyName(PropertyNames.PinnedMessage)] public MaybeInaccessibleMessage? PinnedMessage { get; set; } /// /// Optional. Message is an invoice for a payment, information about the invoice. More about payments » /// [JsonPropertyName(PropertyNames.Invoice)] public Invoice? Invoice { get; set; } /// /// Optional. Message is a service message about a successful payment, information about the payment. More about payments » /// [JsonPropertyName(PropertyNames.SuccessfulPayment)] public SuccessfulPayment? SuccessfulPayment { get; set; } /// /// Optional. Message is a service message about a refunded payment, information about the payment. More about payments » /// [JsonPropertyName(PropertyNames.RefundedPayment)] public RefundedPayment? RefundedPayment { get; set; } /// /// Optional. Service message: users were shared with the bot /// [JsonPropertyName(PropertyNames.UsersShared)] public UsersShared? UsersShared { get; set; } /// /// Optional. Service message: a chat was shared with the bot /// [JsonPropertyName(PropertyNames.ChatShared)] public ChatShared? ChatShared { get; set; } /// /// Optional. Service message: a regular gift was sent or received /// [JsonPropertyName(PropertyNames.Gift)] public GiftInfo? Gift { get; set; } /// /// Optional. Service message: a unique gift was sent or received /// [JsonPropertyName(PropertyNames.UniqueGift)] public UniqueGiftInfo? UniqueGift { get; set; } /// /// Optional. Service message: upgrade of a gift was purchased after the gift was sent /// [JsonPropertyName(PropertyNames.GiftUpgradeSent)] public GiftInfo? GiftUpgradeSent { get; set; } /// /// Optional. The domain name of the website on which the user has logged in. More about Telegram Login » /// [JsonPropertyName(PropertyNames.ConnectedWebsite)] public string? ConnectedWebsite { get; set; } /// /// Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess /// [JsonPropertyName(PropertyNames.WriteAccessAllowed)] public WriteAccessAllowed? WriteAccessAllowed { get; set; } /// /// Optional. Telegram Passport data /// [JsonPropertyName(PropertyNames.PassportData)] public PassportData? PassportData { get; set; } /// /// Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. /// [JsonPropertyName(PropertyNames.ProximityAlertTriggered)] public ProximityAlertTriggered? ProximityAlertTriggered { get; set; } /// /// Optional. Service message: user boosted the chat /// [JsonPropertyName(PropertyNames.BoostAdded)] public ChatBoostAdded? BoostAdded { get; set; } /// /// Optional. Service message: chat background set /// [JsonPropertyName(PropertyNames.ChatBackgroundSet)] public ChatBackground? ChatBackgroundSet { get; set; } /// /// Optional. Service message: some tasks in a checklist were marked as done or not done /// [JsonPropertyName(PropertyNames.ChecklistTasksDone)] public ChecklistTasksDone? ChecklistTasksDone { get; set; } /// /// Optional. Service message: tasks were added to a checklist /// [JsonPropertyName(PropertyNames.ChecklistTasksAdded)] public ChecklistTasksAdded? ChecklistTasksAdded { get; set; } /// /// Optional. Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed /// [JsonPropertyName(PropertyNames.DirectMessagePriceChanged)] public DirectMessagePriceChanged? DirectMessagePriceChanged { get; set; } /// /// Optional. Service message: forum topic created /// [JsonPropertyName(PropertyNames.ForumTopicCreated)] public ForumTopicCreated? ForumTopicCreated { get; set; } /// /// Optional. Service message: forum topic edited /// [JsonPropertyName(PropertyNames.ForumTopicEdited)] public ForumTopicEdited? ForumTopicEdited { get; set; } /// /// Optional. Service message: forum topic closed /// [JsonPropertyName(PropertyNames.ForumTopicClosed)] public ForumTopicClosed? ForumTopicClosed { get; set; } /// /// Optional. Service message: forum topic reopened /// [JsonPropertyName(PropertyNames.ForumTopicReopened)] public ForumTopicReopened? ForumTopicReopened { get; set; } /// /// Optional. Service message: the 'General' forum topic hidden /// [JsonPropertyName(PropertyNames.GeneralForumTopicHidden)] public GeneralForumTopicHidden? GeneralForumTopicHidden { get; set; } /// /// Optional. Service message: the 'General' forum topic unhidden /// [JsonPropertyName(PropertyNames.GeneralForumTopicUnhidden)] public GeneralForumTopicUnhidden? GeneralForumTopicUnhidden { get; set; } /// /// Optional. Service message: a scheduled giveaway was created /// [JsonPropertyName(PropertyNames.GiveawayCreated)] public GiveawayCreated? GiveawayCreated { get; set; } /// /// Optional. The message is a scheduled giveaway message /// [JsonPropertyName(PropertyNames.Giveaway)] public Giveaway? Giveaway { get; set; } /// /// Optional. A giveaway with public winners was completed /// [JsonPropertyName(PropertyNames.GiveawayWinners)] public GiveawayWinners? GiveawayWinners { get; set; } /// /// Optional. Service message: a giveaway without public winners was completed /// [JsonPropertyName(PropertyNames.GiveawayCompleted)] public GiveawayCompleted? GiveawayCompleted { get; set; } /// /// Optional. Service message: user created a bot that will be managed by the current bot /// [JsonPropertyName(PropertyNames.ManagedBotCreated)] public ManagedBotCreated? ManagedBotCreated { get; set; } /// /// Optional. Service message: the price for paid messages has changed in the chat /// [JsonPropertyName(PropertyNames.PaidMessagePriceChanged)] public PaidMessagePriceChanged? PaidMessagePriceChanged { get; set; } /// /// Optional. Service message: answer option was added to a poll /// [JsonPropertyName(PropertyNames.PollOptionAdded)] public PollOptionAdded? PollOptionAdded { get; set; } /// /// Optional. Service message: answer option was deleted from a poll /// [JsonPropertyName(PropertyNames.PollOptionDeleted)] public PollOptionDeleted? PollOptionDeleted { get; set; } /// /// Optional. Service message: a suggested post was approved /// [JsonPropertyName(PropertyNames.SuggestedPostApproved)] public SuggestedPostApproved? SuggestedPostApproved { get; set; } /// /// Optional. Service message: approval of a suggested post has failed /// [JsonPropertyName(PropertyNames.SuggestedPostApprovalFailed)] public SuggestedPostApprovalFailed? SuggestedPostApprovalFailed { get; set; } /// /// Optional. Service message: a suggested post was declined /// [JsonPropertyName(PropertyNames.SuggestedPostDeclined)] public SuggestedPostDeclined? SuggestedPostDeclined { get; set; } /// /// Optional. Service message: payment for a suggested post was received /// [JsonPropertyName(PropertyNames.SuggestedPostPaid)] public SuggestedPostPaid? SuggestedPostPaid { get; set; } /// /// Optional. Service message: payment for a suggested post was refunded /// [JsonPropertyName(PropertyNames.SuggestedPostRefunded)] public SuggestedPostRefunded? SuggestedPostRefunded { get; set; } /// /// Optional. Service message: video chat scheduled /// [JsonPropertyName(PropertyNames.VideoChatScheduled)] public VideoChatScheduled? VideoChatScheduled { get; set; } /// /// Optional. Service message: video chat started /// [JsonPropertyName(PropertyNames.VideoChatStarted)] public VideoChatStarted? VideoChatStarted { get; set; } /// /// Optional. Service message: video chat ended /// [JsonPropertyName(PropertyNames.VideoChatEnded)] public VideoChatEnded? VideoChatEnded { get; set; } /// /// Optional. Service message: new participants invited to a video chat /// [JsonPropertyName(PropertyNames.VideoChatParticipantsInvited)] public VideoChatParticipantsInvited? VideoChatParticipantsInvited { get; set; } /// /// Optional. Service message: data sent by a Web App /// [JsonPropertyName(PropertyNames.WebAppData)] public WebAppData? WebAppData { get; set; } /// /// Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. /// [JsonPropertyName(PropertyNames.ReplyMarkup)] public InlineKeyboardMarkup? ReplyMarkup { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MenuButton/MenuButton.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the bot's menu button in a private chat. It should be one of /// If a menu button other than is set for a private chat, then it is applied in the chat. Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands. /// /// /// /// /// /// [JsonConverter(typeof(MenuButtonConverter))] public abstract class MenuButton { /// /// Type of the button /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MenuButton/MenuButtonCommands.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a menu button, which opens the bot's list of commands. /// public class MenuButtonCommands : MenuButton { /// /// Type of the button, must be commands /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "commands"; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MenuButton/MenuButtonDefault.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes that no specific value for the menu button was set. /// public class MenuButtonDefault : MenuButton { /// /// Type of the button, must be default /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "default"; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MenuButton/MenuButtonWebApp.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a menu button, which launches a Web App. /// public class MenuButtonWebApp : MenuButton { /// /// Type of the button, must be web_app /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "web_app"; /// /// Text on the button /// [JsonPropertyName(PropertyNames.Text)] public string Text { get; set; } = null!; /// /// Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Alternatively, a t.me link to a Web App of the bot can be specified in the object instead of the Web App's URL, in which case the Web App will be opened as if the user pressed the link. /// [JsonPropertyName(PropertyNames.WebApp)] public WebAppInfo WebApp { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MessageAutoDeleteTimerChanged.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a service message about a change in auto-delete timer settings. /// public class MessageAutoDeleteTimerChanged { /// /// New auto-delete time for messages in the chat; in seconds /// [JsonPropertyName(PropertyNames.MessageAutoDeleteTime)] public int MessageAutoDeleteTime { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MessageEntity.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. /// public class MessageEntity { /// /// Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time) /// [JsonPropertyName(PropertyNames.Type)] public string Type { get; set; } = null!; /// /// Offset in UTF-16 code units to the start of the entity /// [JsonPropertyName(PropertyNames.Offset)] public int Offset { get; set; } /// /// Length of the entity in UTF-16 code units /// [JsonPropertyName(PropertyNames.Length)] public int Length { get; set; } /// /// Optional. For “text_link” only, URL that will be opened after user taps on the text /// [JsonPropertyName(PropertyNames.Url)] public string? Url { get; set; } /// /// Optional. For “text_mention” only, the mentioned user /// [JsonPropertyName(PropertyNames.User)] public User? User { get; set; } /// /// Optional. For “pre” only, the programming language of the entity text /// [JsonPropertyName(PropertyNames.Language)] public string? Language { get; set; } /// /// Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker /// [JsonPropertyName(PropertyNames.CustomEmojiId)] public string? CustomEmojiId { get; set; } /// /// Optional. For “date_time” only, the Unix time associated with the entity /// [JsonPropertyName(PropertyNames.UnixTime)] public int? UnixTime { get; set; } /// /// Optional. For “date_time” only, the string that defines the formatting of the date and time. See date-time entity formatting for more details. /// [JsonPropertyName(PropertyNames.DateTimeFormat)] public string? DateTimeFormat { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MessageID.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a unique message identifier. /// public class MessageId { /// /// Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent /// [JsonPropertyName(PropertyNames.MessageId)] public int Id { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MessageOrigin/MessageOrigin.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the origin of a message. It can be one of /// /// /// /// /// /// /// [JsonConverter(typeof(MessageOriginConverter))] public abstract class MessageOrigin { /// /// Type of the message origin /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } /// /// Date the message was sent originally in Unix time /// [JsonPropertyName(PropertyNames.Date)] public int Date { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MessageOrigin/MessageOriginChannel.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The message was originally sent to a channel chat. /// public class MessageOriginChannel : MessageOrigin { /// /// Type of the message origin, always “channel” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "channel"; /// /// Channel chat to which the message was originally sent /// [JsonPropertyName(PropertyNames.Chat)] public Chat Chat { get; set; } = null!; /// /// Unique message identifier inside the chat /// [JsonPropertyName(PropertyNames.MessageId)] public int MessageId { get; set; } /// /// Optional. Signature of the original post author /// [JsonPropertyName(PropertyNames.AuthorSignature)] public string? AuthorSignature { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MessageOrigin/MessageOriginChat.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The message was originally sent on behalf of a chat to a group chat. /// public class MessageOriginChat : MessageOrigin { /// /// Type of the message origin, always “chat” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "chat"; /// /// Chat that sent the message originally /// [JsonPropertyName(PropertyNames.SenderChat)] public Chat SenderChat { get; set; } = null!; /// /// Optional. For messages originally sent by an anonymous chat administrator, original message author signature /// [JsonPropertyName(PropertyNames.AuthorSignature)] public string? AuthorSignature { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MessageOrigin/MessageOriginHiddenUser.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The message was originally sent by an unknown user. /// public class MessageOriginHiddenUser : MessageOrigin { /// /// Type of the message origin, always “hidden_user” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "hidden_user"; /// /// Name of the user that sent the message originally /// [JsonPropertyName(PropertyNames.SenderUserName)] public string SenderUserName { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MessageOrigin/MessageOriginUser.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The message was originally sent by a known user. /// public class MessageOriginUser : MessageOrigin { /// /// Type of the message origin, always “user” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "user"; /// /// User that sent the message originally /// [JsonPropertyName(PropertyNames.SenderUser)] public User SenderUser { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MessageReactionCountUpdated.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents reaction changes on a message with anonymous reactions. /// public class MessageReactionCountUpdated { /// /// The chat containing the message /// [JsonPropertyName(PropertyNames.Chat)] public Chat Chat { get; set; } = null!; /// /// Unique message identifier inside the chat /// [JsonPropertyName(PropertyNames.MessageId)] public int MessageId { get; set; } /// /// Date of the change in Unix time /// [JsonPropertyName(PropertyNames.Date)] public int Date { get; set; } /// /// List of reactions that are present on the message /// [JsonPropertyName(PropertyNames.Reactions)] public IEnumerable Reactions { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/MessageReactionUpdated.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a change of a reaction on a message performed by a user. /// public class MessageReactionUpdated { /// /// The chat containing the message the user reacted to /// [JsonPropertyName(PropertyNames.Chat)] public Chat Chat { get; set; } = null!; /// /// Unique identifier of the message inside the chat /// [JsonPropertyName(PropertyNames.MessageId)] public int MessageId { get; set; } /// /// Optional. The user that changed the reaction, if the user isn't anonymous /// [JsonPropertyName(PropertyNames.User)] public User? User { get; set; } /// /// Optional. The chat on behalf of which the reaction was changed, if the user is anonymous /// [JsonPropertyName(PropertyNames.ActorChat)] public Chat? ActorChat { get; set; } /// /// Date of the change in Unix time /// [JsonPropertyName(PropertyNames.Date)] public int Date { get; set; } /// /// Previous list of reaction types that were set by the user /// [JsonPropertyName(PropertyNames.OldReaction)] public IEnumerable OldReaction { get; set; } = null!; /// /// New list of reaction types that have been set by the user /// [JsonPropertyName(PropertyNames.NewReaction)] public IEnumerable NewReaction { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/OwnedGift/OwnedGift.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes a gift received and owned by a user or a chat. Currently, it can be one of /// /// /// /// /// [JsonConverter(typeof(OwnedGiftConverter))] public abstract class OwnedGift { /// /// Type of the gift /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } /// /// No description available /// [JsonPropertyName(PropertyNames.OwnedGiftId)] public abstract string? OwnedGiftId { get; set; } /// /// Optional. Sender of the gift if it is a known user /// [JsonPropertyName(PropertyNames.SenderUser)] public User? SenderUser { get; set; } /// /// Date the gift was sent in Unix time /// [JsonPropertyName(PropertyNames.SendDate)] public int SendDate { get; set; } /// /// Optional. True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only /// [JsonPropertyName(PropertyNames.IsSaved)] public bool? IsSaved { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/OwnedGift/OwnedGiftRegular.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a regular gift owned by a user or a chat. /// public class OwnedGiftRegular : OwnedGift { /// /// Type of the gift, always “regular” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "regular"; /// /// Information about the regular gift /// [JsonPropertyName(PropertyNames.Gift)] public Gift Gift { get; set; } = null!; /// /// Optional. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only /// [JsonPropertyName(PropertyNames.OwnedGiftId)] public override string? OwnedGiftId { get; set; } /// /// Optional. Text of the message that was added to the gift /// [JsonPropertyName(PropertyNames.Text)] public string? Text { get; set; } /// /// Optional. Special entities that appear in the text /// [JsonPropertyName(PropertyNames.Entities)] public IEnumerable? Entities { get; set; } /// /// Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them /// [JsonPropertyName(PropertyNames.IsPrivate)] public bool? IsPrivate { get; set; } /// /// Optional. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only /// [JsonPropertyName(PropertyNames.CanBeUpgraded)] public bool? CanBeUpgraded { get; set; } /// /// Optional. True, if the gift was refunded and isn't available anymore /// [JsonPropertyName(PropertyNames.WasRefunded)] public bool? WasRefunded { get; set; } /// /// Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only /// [JsonPropertyName(PropertyNames.ConvertStarCount)] public int? ConvertStarCount { get; set; } /// /// Optional. Number of Telegram Stars that were paid for the ability to upgrade the gift /// [JsonPropertyName(PropertyNames.PrepaidUpgradeStarCount)] public int? PrepaidUpgradeStarCount { get; set; } /// /// Optional. True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only /// [JsonPropertyName(PropertyNames.IsUpgradeSeparate)] public bool? IsUpgradeSeparate { get; set; } /// /// Optional. Unique number reserved for this gift when upgraded. See the number field in /// [JsonPropertyName(PropertyNames.UniqueGiftNumber)] public int? UniqueGiftNumber { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/OwnedGift/OwnedGiftUnique.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a unique gift received and owned by a user or a chat. /// public class OwnedGiftUnique : OwnedGift { /// /// Type of the gift, always “unique” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "unique"; /// /// Information about the unique gift /// [JsonPropertyName(PropertyNames.Gift)] public UniqueGift Gift { get; set; } = null!; /// /// Optional. Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only /// [JsonPropertyName(PropertyNames.OwnedGiftId)] public override string? OwnedGiftId { get; set; } /// /// Optional. True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only /// [JsonPropertyName(PropertyNames.CanBeTransferred)] public bool? CanBeTransferred { get; set; } /// /// Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift /// [JsonPropertyName(PropertyNames.TransferStarCount)] public int? TransferStarCount { get; set; } /// /// Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now /// [JsonPropertyName(PropertyNames.NextTransferDate)] public int? NextTransferDate { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/OwnedGifts.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Contains the list of gifts received and owned by a user or a chat. /// public class OwnedGifts { /// /// The total number of gifts owned by the user or the chat /// [JsonPropertyName(PropertyNames.TotalCount)] public int TotalCount { get; set; } /// /// The list of gifts /// [JsonPropertyName(PropertyNames.Gifts)] public IEnumerable Gifts { get; set; } = null!; /// /// Optional. Offset for the next request. If empty, then there are no more results /// [JsonPropertyName(PropertyNames.NextOffset)] public string? NextOffset { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PaidMedia/PaidMedia.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes paid media. Currently, it can be one of /// /// /// /// /// /// /// [JsonConverter(typeof(PaidMediaConverter))] public abstract class PaidMedia { /// /// Type of the paid media /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PaidMedia/PaidMediaLivePhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The paid media is a live photo. /// public class PaidMediaLivePhoto : PaidMedia { /// /// Type of the paid media, always “live_photo” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "live_photo"; /// /// The photo /// [JsonPropertyName(PropertyNames.LivePhoto)] public LivePhoto LivePhoto { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PaidMedia/PaidMediaPhoto.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The paid media is a photo. /// public class PaidMediaPhoto : PaidMedia { /// /// Type of the paid media, always “photo” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "photo"; /// /// The photo /// [JsonPropertyName(PropertyNames.Photo)] public IEnumerable Photo { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PaidMedia/PaidMediaPreview.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The paid media isn't available before the payment. /// public class PaidMediaPreview : PaidMedia { /// /// Type of the paid media, always “preview” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "preview"; /// /// Optional. Media width as defined by the sender /// [JsonPropertyName(PropertyNames.Width)] public int? Width { get; set; } /// /// Optional. Media height as defined by the sender /// [JsonPropertyName(PropertyNames.Height)] public int? Height { get; set; } /// /// Optional. Duration of the media in seconds as defined by the sender /// [JsonPropertyName(PropertyNames.Duration)] public int? Duration { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PaidMedia/PaidMediaVideo.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The paid media is a video. /// public class PaidMediaVideo : PaidMedia { /// /// Type of the paid media, always “video” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "video"; /// /// The video /// [JsonPropertyName(PropertyNames.Video)] public Video Video { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PaidMediaInfo.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes the paid media added to a message. /// public class PaidMediaInfo { /// /// The number of Telegram Stars that must be paid to buy access to the media /// [JsonPropertyName(PropertyNames.StarCount)] public int StarCount { get; set; } /// /// Information about the paid media /// [JsonPropertyName(PropertyNames.PaidMedia)] public IEnumerable PaidMedia { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PaidMessagePriceChanged.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about a change in the price of paid messages within a chat. /// public class PaidMessagePriceChanged { /// /// The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message /// [JsonPropertyName(PropertyNames.PaidMessageStarCount)] public int PaidMessageStarCount { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PhotoSize.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents one size of a photo or a file / sticker thumbnail. /// public class PhotoSize { /// /// Identifier for this file, which can be used to download or reuse the file /// [JsonPropertyName(PropertyNames.FileId)] public string FileId { get; set; } = null!; /// /// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. /// [JsonPropertyName(PropertyNames.FileUniqueId)] public string FileUniqueId { get; set; } = null!; /// /// Photo width /// [JsonPropertyName(PropertyNames.Width)] public int Width { get; set; } /// /// Photo height /// [JsonPropertyName(PropertyNames.Height)] public int Height { get; set; } /// /// Optional. File size in bytes /// [JsonPropertyName(PropertyNames.FileSize)] public long? FileSize { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Poll.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains information about a poll. /// public class Poll { /// /// Unique poll identifier /// [JsonPropertyName(PropertyNames.Id)] public string Id { get; set; } = null!; /// /// Poll question, 1-300 characters /// [JsonPropertyName(PropertyNames.Question)] public string Question { get; set; } = null!; /// /// Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions /// [JsonPropertyName(PropertyNames.QuestionEntities)] public IEnumerable? QuestionEntities { get; set; } /// /// List of poll options /// [JsonPropertyName(PropertyNames.Options)] public IEnumerable Options { get; set; } = null!; /// /// Total number of users that voted in the poll /// [JsonPropertyName(PropertyNames.TotalVoterCount)] public int TotalVoterCount { get; set; } /// /// True, if the poll is closed /// [JsonPropertyName(PropertyNames.IsClosed)] public bool IsClosed { get; set; } /// /// True, if the poll is anonymous /// [JsonPropertyName(PropertyNames.IsAnonymous)] public bool IsAnonymous { get; set; } /// /// Poll type, currently can be “regular” or “quiz” /// [JsonPropertyName(PropertyNames.Type)] public string Type { get; set; } = null!; /// /// True, if the poll allows multiple answers /// [JsonPropertyName(PropertyNames.AllowsMultipleAnswers)] public bool AllowsMultipleAnswers { get; set; } /// /// True, if the poll allows to change the chosen answer options /// [JsonPropertyName(PropertyNames.AllowsRevoting)] public bool AllowsRevoting { get; set; } /// /// True if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours /// [JsonPropertyName(PropertyNames.MembersOnly)] public bool MembersOnly { get; set; } /// /// Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. If omitted, then users from any country can participate in the poll. /// [JsonPropertyName(PropertyNames.CountryCodes)] public IEnumerable? CountryCodes { get; set; } /// /// Optional. Array of 0-based identifiers of the correct answer options. Available only for polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with the bot. /// [JsonPropertyName(PropertyNames.CorrectOptionIds)] public IEnumerable? CorrectOptionIds { get; set; } /// /// Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters /// [JsonPropertyName(PropertyNames.Explanation)] public string? Explanation { get; set; } /// /// Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation /// [JsonPropertyName(PropertyNames.ExplanationEntities)] public IEnumerable? ExplanationEntities { get; set; } /// /// Optional. Media added to the quiz explanation /// [JsonPropertyName(PropertyNames.ExplanationMedia)] public PollMedia? ExplanationMedia { get; set; } /// /// Optional. Amount of time in seconds the poll will be active after creation /// [JsonPropertyName(PropertyNames.OpenPeriod)] public int? OpenPeriod { get; set; } /// /// Optional. Point in time (Unix timestamp) when the poll will be automatically closed /// [JsonPropertyName(PropertyNames.CloseDate)] public int? CloseDate { get; set; } /// /// Optional. Description of the poll; for polls inside the object only /// [JsonPropertyName(PropertyNames.Description)] public string? Description { get; set; } /// /// Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the description /// [JsonPropertyName(PropertyNames.DescriptionEntities)] public IEnumerable? DescriptionEntities { get; set; } /// /// Optional. Media added to the poll description; for polls inside the object only /// [JsonPropertyName(PropertyNames.Media)] public PollMedia? Media { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PollAnswer.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents an answer of a user in a non-anonymous poll. /// public class PollAnswer { /// /// Unique poll identifier /// [JsonPropertyName(PropertyNames.PollId)] public string PollId { get; set; } = null!; /// /// Optional. The chat that changed the answer to the poll, if the voter is anonymous /// [JsonPropertyName(PropertyNames.VoterChat)] public Chat? VoterChat { get; set; } /// /// Optional. The user that changed the answer to the poll, if the voter isn't anonymous /// [JsonPropertyName(PropertyNames.User)] public User? User { get; set; } /// /// 0-based identifiers of chosen answer options. May be empty if the vote was retracted. /// [JsonPropertyName(PropertyNames.OptionIds)] public IEnumerable OptionIds { get; set; } = null!; /// /// Persistent identifiers of the chosen answer options. May be empty if the vote was retracted. /// [JsonPropertyName(PropertyNames.OptionPersistentIds)] public IEnumerable OptionPersistentIds { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PollMedia.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Stickers; namespace Telegram.BotAPI.AvailableTypes; /// /// At most one of the optional fields can be present in any given object. /// public class PollMedia { /// /// Optional. Media is an animation, information about the animation /// [JsonPropertyName(PropertyNames.Animation)] public Animation? Animation { get; set; } /// /// Optional. Media is an audio file, information about the file; currently, can't be received in a poll option /// [JsonPropertyName(PropertyNames.Audio)] public Audio? Audio { get; set; } /// /// Optional. Media is a general file, information about the file; currently, can't be received in a poll option /// [JsonPropertyName(PropertyNames.Document)] public Document? Document { get; set; } /// /// Optional. Media is a live photo, information about the live photo /// [JsonPropertyName(PropertyNames.LivePhoto)] public LivePhoto? LivePhoto { get; set; } /// /// Optional. Media is a shared location, information about the location /// [JsonPropertyName(PropertyNames.Location)] public Location? Location { get; set; } /// /// Optional. Media is a photo, available sizes of the photo /// [JsonPropertyName(PropertyNames.Photo)] public IEnumerable? Photo { get; set; } /// /// Optional. Media is a sticker, information about the sticker; currently, for poll options only /// [JsonPropertyName(PropertyNames.Sticker)] public Sticker? Sticker { get; set; } /// /// Optional. Media is a venue, information about the venue /// [JsonPropertyName(PropertyNames.Venue)] public Venue? Venue { get; set; } /// /// Optional. Media is a video, information about the video /// [JsonPropertyName(PropertyNames.Video)] public Video? Video { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PollOption.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains information about one answer option in a poll. /// public class PollOption { /// /// Unique identifier of the option, persistent on option addition and deletion /// [JsonPropertyName(PropertyNames.PersistentId)] public string PersistentId { get; set; } = null!; /// /// Option text, 1-100 characters /// [JsonPropertyName(PropertyNames.Text)] public string Text { get; set; } = null!; /// /// Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts /// [JsonPropertyName(PropertyNames.TextEntities)] public IEnumerable? TextEntities { get; set; } /// /// Optional. Media added to the poll option /// [JsonPropertyName(PropertyNames.Media)] public PollMedia? Media { get; set; } /// /// Number of users who voted for this option; may be 0 if unknown /// [JsonPropertyName(PropertyNames.VoterCount)] public int VoterCount { get; set; } /// /// Optional. User who added the option; omitted if the option wasn't added by a user after poll creation /// [JsonPropertyName(PropertyNames.AddedByUser)] public User? AddedByUser { get; set; } /// /// Optional. Chat that added the option; omitted if the option wasn't added by a chat after poll creation /// [JsonPropertyName(PropertyNames.AddedByChat)] public Chat? AddedByChat { get; set; } /// /// Optional. Point in time (Unix timestamp) when the option was added; omitted if the option existed in the original poll /// [JsonPropertyName(PropertyNames.AdditionDate)] public int? AdditionDate { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PollOptionAdded.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about an option added to a poll. /// public class PollOptionAdded { /// /// Optional. Message containing the poll to which the option was added, if known. Note that the object in this field will not contain the reply_to_message field even if it itself is a reply. /// [JsonPropertyName(PropertyNames.PollMessage)] public MaybeInaccessibleMessage? PollMessage { get; set; } /// /// Unique identifier of the added option /// [JsonPropertyName(PropertyNames.OptionPersistentId)] public string OptionPersistentId { get; set; } = null!; /// /// Option text /// [JsonPropertyName(PropertyNames.OptionText)] public string OptionText { get; set; } = null!; /// /// Optional. Special entities that appear in the option_text /// [JsonPropertyName(PropertyNames.OptionTextEntities)] public IEnumerable? OptionTextEntities { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PollOptionDeleted.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about an option deleted from a poll. /// public class PollOptionDeleted { /// /// Optional. Message containing the poll from which the option was deleted, if known. Note that the object in this field will not contain the reply_to_message field even if it itself is a reply. /// [JsonPropertyName(PropertyNames.PollMessage)] public MaybeInaccessibleMessage? PollMessage { get; set; } /// /// Unique identifier of the deleted option /// [JsonPropertyName(PropertyNames.OptionPersistentId)] public string OptionPersistentId { get; set; } = null!; /// /// Option text /// [JsonPropertyName(PropertyNames.OptionText)] public string OptionText { get; set; } = null!; /// /// Optional. Special entities that appear in the option_text /// [JsonPropertyName(PropertyNames.OptionTextEntities)] public IEnumerable? OptionTextEntities { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PreparedInlineMessage.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes an inline message to be sent by a user of a Mini App. /// public class PreparedInlineMessage { /// /// Unique identifier of the prepared message /// [JsonPropertyName(PropertyNames.Id)] public string Id { get; set; } = null!; /// /// Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used /// [JsonPropertyName(PropertyNames.ExpirationDate)] public int ExpirationDate { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/PreparedKeyboardButton.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a keyboard button to be used by a user of a Mini App. /// public class PreparedKeyboardButton { /// /// Unique identifier of the keyboard button /// [JsonPropertyName(PropertyNames.Id)] public string Id { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ProximityAlertTriggered.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. /// public class ProximityAlertTriggered { /// /// User that triggered the alert /// [JsonPropertyName(PropertyNames.Traveler)] public User Traveler { get; set; } = null!; /// /// User that set the alert /// [JsonPropertyName(PropertyNames.Watcher)] public User Watcher { get; set; } = null!; /// /// The distance between the users /// [JsonPropertyName(PropertyNames.Distance)] public int Distance { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ReactionCount.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Represents a reaction added to a message along with the number of times it was added. /// public class ReactionCount { /// /// Type of the reaction /// [JsonPropertyName(PropertyNames.Type)] public ReactionType Type { get; set; } = null!; /// /// Number of times the reaction was added /// [JsonPropertyName(PropertyNames.TotalCount)] public int TotalCount { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ReactionType/ReactionType.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the type of a reaction. Currently, it can be one of /// /// /// /// /// /// [JsonConverter(typeof(ReactionTypeConverter))] public abstract class ReactionType { /// /// Type of the reaction /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ReactionType/ReactionTypeCustomEmoji.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The reaction is based on a custom emoji. /// public class ReactionTypeCustomEmoji : ReactionType { /// /// Initializes a new instance of the class. /// /// Custom emoji identifier public ReactionTypeCustomEmoji(string customEmojiId) { this.CustomEmojiId = customEmojiId ?? throw new ArgumentNullException(nameof(customEmojiId)); } /// /// Type of the reaction, always “custom_emoji” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "custom_emoji"; /// /// Custom emoji identifier /// [JsonPropertyName(PropertyNames.CustomEmojiId)] public string CustomEmojiId { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ReactionType/ReactionTypeEmoji.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The reaction is based on an emoji. /// public class ReactionTypeEmoji : ReactionType { /// /// Initializes a new instance of the class. /// /// Reaction emoji. Currently, it can be one of "❤", "👍", "👎", "🔥", "🥰", "👏", "😁", "🤔", "🤯", "😱", "🤬", "😢", "🎉", "🤩", "🤮", "💩", "🙏", "👌", "🕊", "🤡", "🥱", "🥴", "😍", "🐳", "❤‍🔥", "🌚", "🌭", "💯", "🤣", "⚡", "🍌", "🏆", "💔", "🤨", "😐", "🍓", "🍾", "💋", "🖕", "😈", "😴", "😭", "🤓", "👻", "👨‍💻", "👀", "🎃", "🙈", "😇", "😨", "🤝", "✍", "🤗", "🫡", "🎅", "🎄", "☃", "💅", "🤪", "🗿", "🆒", "💘", "🙉", "🦄", "😘", "💊", "🙊", "😎", "👾", "🤷‍♂", "🤷", "🤷‍♀", "😡" public ReactionTypeEmoji(string emoji) { this.Emoji = emoji ?? throw new ArgumentNullException(nameof(emoji)); } /// /// Type of the reaction, always “emoji” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "emoji"; /// /// Reaction emoji. Currently, it can be one of "❤", "👍", "👎", "🔥", "🥰", "👏", "😁", "🤔", "🤯", "😱", "🤬", "😢", "🎉", "🤩", "🤮", "💩", "🙏", "👌", "🕊", "🤡", "🥱", "🥴", "😍", "🐳", "❤‍🔥", "🌚", "🌭", "💯", "🤣", "⚡", "🍌", "🏆", "💔", "🤨", "😐", "🍓", "🍾", "💋", "🖕", "😈", "😴", "😭", "🤓", "👻", "👨‍💻", "👀", "🎃", "🙈", "😇", "😨", "🤝", "✍", "🤗", "🫡", "🎅", "🎄", "☃", "💅", "🤪", "🗿", "🆒", "💘", "🙉", "🦄", "😘", "💊", "🙊", "😎", "👾", "🤷‍♂", "🤷", "🤷‍♀", "😡" /// [JsonPropertyName(PropertyNames.Emoji)] public string Emoji { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ReactionType/ReactionTypePaid.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// The reaction is paid. /// public class ReactionTypePaid : ReactionType { /// /// Type of the reaction, always “paid” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "paid"; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ReplyMarkup/ForceReply.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a user account. /// public class ForceReply : ReplyMarkup { /// /// Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' /// [JsonPropertyName(PropertyNames.ForceReply)] public bool ForceReplyFlag => true; /// /// Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters /// [JsonPropertyName(PropertyNames.InputFieldPlaceholder)] public string? InputFieldPlaceholder { get; set; } /// /// Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. /// [JsonPropertyName(PropertyNames.Selective)] public bool? Selective { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ReplyMarkup/InlineKeyboardMarkup.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents an inline keyboard that appears right next to the message it belongs to. /// public class InlineKeyboardMarkup : ReplyMarkup { /// /// Initializes a new instance of the class. /// /// Array of button rows, each represented by an Array of objects public InlineKeyboardMarkup(IEnumerable> inlineKeyboard) { this.InlineKeyboard = inlineKeyboard ?? throw new ArgumentNullException(nameof(inlineKeyboard)); } /// /// Array of button rows, each represented by an Array of objects /// [JsonPropertyName(PropertyNames.InlineKeyboard)] public IEnumerable> InlineKeyboard { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ReplyMarkup/ReplyKeyboardMarkup.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a business account. /// public class ReplyKeyboardMarkup : ReplyMarkup { /// /// Initializes a new instance of the class. /// /// Array of button rows, each represented by an Array of objects public ReplyKeyboardMarkup(IEnumerable> keyboard) { this.Keyboard = keyboard ?? throw new ArgumentNullException(nameof(keyboard)); } /// /// Array of button rows, each represented by an Array of objects /// [JsonPropertyName(PropertyNames.Keyboard)] public IEnumerable> Keyboard { get; set; } /// /// Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon. /// [JsonPropertyName(PropertyNames.IsPersistent)] public bool? IsPersistent { get; set; } /// /// Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. /// [JsonPropertyName(PropertyNames.ResizeKeyboard)] public bool? ResizeKeyboard { get; set; } /// /// Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false. /// [JsonPropertyName(PropertyNames.OneTimeKeyboard)] public bool? OneTimeKeyboard { get; set; } /// /// Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters /// [JsonPropertyName(PropertyNames.InputFieldPlaceholder)] public string? InputFieldPlaceholder { get; set; } /// /// Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.

Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. ///
[JsonPropertyName(PropertyNames.Selective)] public bool? Selective { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ReplyMarkup/ReplyKeyboardRemove.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ). Not supported in channels and for messages sent on behalf of a business account. /// public class ReplyKeyboardRemove : ReplyMarkup { /// /// Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ) /// [JsonPropertyName(PropertyNames.RemoveKeyboard)] public bool RemoveKeyboard => true; /// /// Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.

Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet. ///
[JsonPropertyName(PropertyNames.Selective)] public bool? Selective { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ReplyMarkup/ReplyMarkup.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. /// /// /// /// /// /// /// [JsonConverter(typeof(ReplyMarkupConverter))] public abstract class ReplyMarkup { } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ReplyParameters.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes reply parameters for the message that is being sent. /// public class ReplyParameters { /// /// Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified /// [JsonPropertyName(PropertyNames.MessageId)] public int MessageId { get; set; } /// /// Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the bot, supergroup or channel in the format @username. Not supported for messages sent on behalf of a business account and messages from channel direct messages chats. /// [JsonPropertyName(PropertyNames.ChatId)] public object? ChatId { get; set; } /// /// Optional. Pass True if the message should be sent even if the specified message to be replied to is not found. Always False for replies in another chat or forum topic. Always True for messages sent on behalf of a business account. /// [JsonPropertyName(PropertyNames.AllowSendingWithoutReply)] public bool? AllowSendingWithoutReply { get; set; } /// /// Optional. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities. The message will fail to send if the quote isn't found in the original message. /// [JsonPropertyName(PropertyNames.Quote)] public string? Quote { get; set; } /// /// Optional. Mode for parsing entities in the quote. See formatting options for more details. /// [JsonPropertyName(PropertyNames.QuoteParseMode)] public string? QuoteParseMode { get; set; } /// /// Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode. /// [JsonPropertyName(PropertyNames.QuoteEntities)] public IEnumerable? QuoteEntities { get; set; } /// /// Optional. Position of the quote in the original message in UTF-16 code units /// [JsonPropertyName(PropertyNames.QuotePosition)] public int? QuotePosition { get; set; } /// /// Optional. Identifier of the specific checklist task to be replied to /// [JsonPropertyName(PropertyNames.ChecklistTaskId)] public int? ChecklistTaskId { get; set; } /// /// Optional. Persistent identifier of the specific poll option to be replied to /// [JsonPropertyName(PropertyNames.PollOptionId)] public string? PollOptionId { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/ResponseParameters.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes why a request was unsuccessful. /// public class ResponseParameters { /// /// Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. /// [JsonPropertyName(PropertyNames.MigrateToChatId)] public long? MigrateToChatId { get; set; } /// /// Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated /// [JsonPropertyName(PropertyNames.RetryAfter)] public int? RetryAfter { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/SentGuestMessage.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes an inline message sent by a guest bot. /// public class SentGuestMessage { /// /// Identifier of the sent inline message /// [JsonPropertyName(PropertyNames.InlineMessageId)] public string InlineMessageId { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/SentWebAppMessage.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes an inline message sent by a Web App on behalf of a user. /// public class SentWebAppMessage { /// /// Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. /// [JsonPropertyName(PropertyNames.InlineMessageId)] public string? InlineMessageId { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/SharedUser.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains information about a user that was shared with the bot using a button. /// public class SharedUser { /// /// Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. /// [JsonPropertyName(PropertyNames.UserId)] public long UserId { get; set; } /// /// Optional. First name of the user, if the name was requested by the bot /// [JsonPropertyName(PropertyNames.FirstName)] public string? FirstName { get; set; } /// /// Optional. Last name of the user, if the name was requested by the bot /// [JsonPropertyName(PropertyNames.LastName)] public string? LastName { get; set; } /// /// Optional. Username of the user, if the username was requested by the bot /// [JsonPropertyName(PropertyNames.Username)] public string? Username { get; set; } /// /// Optional. Available sizes of the chat photo, if the photo was requested by the bot /// [JsonPropertyName(PropertyNames.Photo)] public IEnumerable? Photo { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/StarAmount.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes an amount of Telegram Stars. /// public class StarAmount { /// /// Integer amount of Telegram Stars, rounded to 0; can be negative /// [JsonPropertyName(PropertyNames.Amount)] public int Amount { get; set; } /// /// Optional. The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive /// [JsonPropertyName(PropertyNames.NanostarAmount)] public int? NanostarAmount { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/Story.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a story. /// public class Story { /// /// Chat that posted the story /// [JsonPropertyName(PropertyNames.Chat)] public Chat Chat { get; set; } = null!; /// /// Unique identifier for the story in the chat /// [JsonPropertyName(PropertyNames.Id)] public int Id { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/StoryArea.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a clickable area on a story media. /// public class StoryArea { /// /// Position of the area /// [JsonPropertyName(PropertyNames.Position)] public StoryAreaPosition Position { get; set; } = null!; /// /// Type of the area /// [JsonPropertyName(PropertyNames.Type)] public StoryAreaType Type { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/StoryAreaPosition.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes the position of a clickable area within a story. /// public class StoryAreaPosition { /// /// The abscissa of the area's center, as a percentage of the media width /// [JsonPropertyName(PropertyNames.XPercentage)] public float XPercentage { get; set; } /// /// The ordinate of the area's center, as a percentage of the media height /// [JsonPropertyName(PropertyNames.YPercentage)] public float YPercentage { get; set; } /// /// The width of the area's rectangle, as a percentage of the media width /// [JsonPropertyName(PropertyNames.WidthPercentage)] public float WidthPercentage { get; set; } /// /// The height of the area's rectangle, as a percentage of the media height /// [JsonPropertyName(PropertyNames.HeightPercentage)] public float HeightPercentage { get; set; } /// /// The clockwise rotation angle of the rectangle, in degrees; 0-360 /// [JsonPropertyName(PropertyNames.RotationAngle)] public float RotationAngle { get; set; } /// /// The radius of the rectangle corner rounding, as a percentage of the media width /// [JsonPropertyName(PropertyNames.CornerRadiusPercentage)] public float CornerRadiusPercentage { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/StoryAreaType/StoryAreaType.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Converters; namespace Telegram.BotAPI.AvailableTypes; /// /// Describes the type of a clickable area on a story. Currently, it can be one of /// /// /// /// /// /// /// /// [JsonConverter(typeof(StoryAreaTypeConverter))] public abstract class StoryAreaType { /// /// Type of the area /// [JsonPropertyName(PropertyNames.Type)] public abstract string Type { get; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/StoryAreaType/StoryAreaTypeLink.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas. /// public class StoryAreaTypeLink : StoryAreaType { /// /// Type of the area, always “link” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "link"; /// /// HTTP or tg:// URL to be opened when the area is clicked /// [JsonPropertyName(PropertyNames.Url)] public string Url { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/StoryAreaType/StoryAreaTypeLocation.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a story area pointing to a location. Currently, a story can have up to 10 location areas. /// public class StoryAreaTypeLocation : StoryAreaType { /// /// Type of the area, always “location” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "location"; /// /// Location latitude in degrees /// [JsonPropertyName(PropertyNames.Latitude)] public float Latitude { get; set; } /// /// Location longitude in degrees /// [JsonPropertyName(PropertyNames.Longitude)] public float Longitude { get; set; } /// /// Optional. Address of the location /// [JsonPropertyName(PropertyNames.Address)] public LocationAddress? Address { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/StoryAreaType/StoryAreaTypeSuggestedReaction.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas. /// public class StoryAreaTypeSuggestedReaction : StoryAreaType { /// /// Type of the area, always “suggested_reaction” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "suggested_reaction"; /// /// Type of the reaction /// [JsonPropertyName(PropertyNames.ReactionType)] public ReactionType ReactionType { get; set; } = null!; /// /// Optional. Pass True if the reaction area has a dark background /// [JsonPropertyName(PropertyNames.IsDark)] public bool? IsDark { get; set; } /// /// Optional. Pass True if reaction area corner is flipped /// [JsonPropertyName(PropertyNames.IsFlipped)] public bool? IsFlipped { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/StoryAreaType/StoryAreaTypeUniqueGift.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area. /// public class StoryAreaTypeUniqueGift : StoryAreaType { /// /// Type of the area, always “unique_gift” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "unique_gift"; /// /// Unique name of the gift /// [JsonPropertyName(PropertyNames.Name)] public string Name { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/StoryAreaType/StoryAreaTypeWeather.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a story area containing weather information. Currently, a story can have up to 3 weather areas. /// public class StoryAreaTypeWeather : StoryAreaType { /// /// Type of the area, always “weather” /// [JsonPropertyName(PropertyNames.Type)] public override string Type => "weather"; /// /// Temperature, in degree Celsius /// [JsonPropertyName(PropertyNames.Temperature)] public float Temperature { get; set; } /// /// Emoji representing the weather /// [JsonPropertyName(PropertyNames.Emoji)] public string Emoji { get; set; } = null!; /// /// A color of the area background in the ARGB format /// [JsonPropertyName(PropertyNames.BackgroundColor)] public int BackgroundColor { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/SuggestedPostApprovalFailed.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval. /// public class SuggestedPostApprovalFailed { /// /// Optional. Message containing the suggested post whose approval has failed. Note that the object in this field will not contain the reply_to_message field even if it itself is a reply. /// [JsonPropertyName(PropertyNames.SuggestedPostMessage)] public Message? SuggestedPostMessage { get; set; } /// /// Expected price of the post /// [JsonPropertyName(PropertyNames.Price)] public SuggestedPostPrice Price { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/SuggestedPostApproved.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about the approval of a suggested post. /// public class SuggestedPostApproved { /// /// Optional. Message containing the suggested post. Note that the object in this field will not contain the reply_to_message field even if it itself is a reply. /// [JsonPropertyName(PropertyNames.SuggestedPostMessage)] public Message? SuggestedPostMessage { get; set; } /// /// Optional. Amount paid for the post /// [JsonPropertyName(PropertyNames.Price)] public SuggestedPostPrice? Price { get; set; } /// /// Date when the post will be published /// [JsonPropertyName(PropertyNames.SendDate)] public int SendDate { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/SuggestedPostDeclined.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about the rejection of a suggested post. /// public class SuggestedPostDeclined { /// /// Optional. Message containing the suggested post. Note that the object in this field will not contain the reply_to_message field even if it itself is a reply. /// [JsonPropertyName(PropertyNames.SuggestedPostMessage)] public Message? SuggestedPostMessage { get; set; } /// /// Optional. Comment with which the post was declined /// [JsonPropertyName(PropertyNames.Comment)] public string? Comment { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/SuggestedPostInfo.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Contains information about a suggested post. /// public class SuggestedPostInfo { /// /// State of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”. /// [JsonPropertyName(PropertyNames.State)] public string State { get; set; } = null!; /// /// Optional. Proposed price of the post. If the field is omitted, then the post is unpaid. /// [JsonPropertyName(PropertyNames.Price)] public SuggestedPostPrice? Price { get; set; } /// /// Optional. Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it. /// [JsonPropertyName(PropertyNames.SendDate)] public int? SendDate { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/SuggestedPostPaid.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about a successful payment for a suggested post. /// public class SuggestedPostPaid { /// /// Optional. Message containing the suggested post. Note that the object in this field will not contain the reply_to_message field even if it itself is a reply. /// [JsonPropertyName(PropertyNames.SuggestedPostMessage)] public Message? SuggestedPostMessage { get; set; } /// /// Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins /// [JsonPropertyName(PropertyNames.Currency)] public string Currency { get; set; } = null!; /// /// Optional. The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins only /// [JsonPropertyName(PropertyNames.Amount)] public int? Amount { get; set; } /// /// Optional. The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only /// [JsonPropertyName(PropertyNames.StarAmount)] public StarAmount? StarAmount { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/SuggestedPostParameters.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Contains parameters of a post that is being suggested by the bot. /// public class SuggestedPostParameters { /// /// Optional. Proposed price for the post. If the field is omitted, then the post is unpaid. /// [JsonPropertyName(PropertyNames.Price)] public SuggestedPostPrice? Price { get; set; } /// /// Optional. Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it. /// [JsonPropertyName(PropertyNames.SendDate)] public int? SendDate { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/SuggestedPostPrice.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes the price of a suggested post. /// public class SuggestedPostPrice { /// /// Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins /// [JsonPropertyName(PropertyNames.Currency)] public string Currency { get; set; } = null!; /// /// The amount of the currency that will be paid for the post in the smallest units of the currency, i.e. Telegram Stars or nanotoncoins. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins must be between 10000000 and 10000000000000. /// [JsonPropertyName(PropertyNames.Amount)] public int Amount { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/SuggestedPostRefunded.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about a payment refund for a suggested post. /// public class SuggestedPostRefunded { /// /// Optional. Message containing the suggested post. Note that the object in this field will not contain the reply_to_message field even if it itself is a reply. /// [JsonPropertyName(PropertyNames.SuggestedPostMessage)] public Message? SuggestedPostMessage { get; set; } /// /// Reason for the refund. Currently, one of “post_deleted” if the post was deleted within 24 hours of being posted or removed from scheduled messages without being posted, or “payment_refunded” if the payer refunded their payment. /// [JsonPropertyName(PropertyNames.Reason)] public string Reason { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/SwitchInlineQueryChosenChat.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query. /// public class SwitchInlineQueryChosenChat { /// /// Optional. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted /// [JsonPropertyName(PropertyNames.Query)] public string? Query { get; set; } /// /// Optional. True, if private chats with users can be chosen /// [JsonPropertyName(PropertyNames.AllowUserChats)] public bool? AllowUserChats { get; set; } /// /// Optional. True, if private chats with bots can be chosen /// [JsonPropertyName(PropertyNames.AllowBotChats)] public bool? AllowBotChats { get; set; } /// /// Optional. True, if group and supergroup chats can be chosen /// [JsonPropertyName(PropertyNames.AllowGroupChats)] public bool? AllowGroupChats { get; set; } /// /// Optional. True, if channel chats can be chosen /// [JsonPropertyName(PropertyNames.AllowChannelChats)] public bool? AllowChannelChats { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/TextQuote.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains information about the quoted part of a message that is replied to by the given message. /// public class TextQuote { /// /// Text of the quoted part of a message that is replied to by the given message /// [JsonPropertyName(PropertyNames.Text)] public string Text { get; set; } = null!; /// /// Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are kept in quotes. /// [JsonPropertyName(PropertyNames.Entities)] public IEnumerable? Entities { get; set; } /// /// Approximate quote position in the original message in UTF-16 code units as specified by the sender /// [JsonPropertyName(PropertyNames.Position)] public int Position { get; set; } /// /// Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server. /// [JsonPropertyName(PropertyNames.IsManual)] public bool? IsManual { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/UniqueGift.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes a unique gift that was upgraded from a regular gift. /// public class UniqueGift { /// /// Identifier of the regular gift from which the gift was upgraded /// [JsonPropertyName(PropertyNames.GiftId)] public string GiftId { get; set; } = null!; /// /// Human-readable name of the regular gift from which this unique gift was upgraded /// [JsonPropertyName(PropertyNames.BaseName)] public string BaseName { get; set; } = null!; /// /// Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas /// [JsonPropertyName(PropertyNames.Name)] public string Name { get; set; } = null!; /// /// Unique number of the upgraded gift among gifts upgraded from the same regular gift /// [JsonPropertyName(PropertyNames.Number)] public int Number { get; set; } /// /// Model of the gift /// [JsonPropertyName(PropertyNames.Model)] public UniqueGiftModel Model { get; set; } = null!; /// /// Symbol of the gift /// [JsonPropertyName(PropertyNames.Symbol)] public UniqueGiftSymbol Symbol { get; set; } = null!; /// /// Backdrop of the gift /// [JsonPropertyName(PropertyNames.Backdrop)] public UniqueGiftBackdrop Backdrop { get; set; } = null!; /// /// Optional. True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers /// [JsonPropertyName(PropertyNames.IsPremium)] public bool? IsPremium { get; set; } /// /// Optional. True, if the gift was used to craft another gift and isn't available anymore /// [JsonPropertyName(PropertyNames.IsBurned)] public bool? IsBurned { get; set; } /// /// Optional. True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram /// [JsonPropertyName(PropertyNames.IsFromBlockchain)] public bool? IsFromBlockchain { get; set; } /// /// Optional. The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only /// [JsonPropertyName(PropertyNames.Colors)] public UniqueGiftColors? Colors { get; set; } /// /// Optional. Information about the chat that published the gift /// [JsonPropertyName(PropertyNames.PublisherChat)] public Chat? PublisherChat { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/UniqueGiftBackdrop.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the backdrop of a unique gift. /// public class UniqueGiftBackdrop { /// /// Name of the backdrop /// [JsonPropertyName(PropertyNames.Name)] public string Name { get; set; } = null!; /// /// Colors of the backdrop /// [JsonPropertyName(PropertyNames.Colors)] public UniqueGiftBackdropColors Colors { get; set; } = null!; /// /// The number of unique gifts that receive this backdrop for every 1000 gifts upgraded /// [JsonPropertyName(PropertyNames.RarityPerMille)] public int RarityPerMille { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/UniqueGiftBackdropColors.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the colors of the backdrop of a unique gift. /// public class UniqueGiftBackdropColors { /// /// The color in the center of the backdrop in RGB format /// [JsonPropertyName(PropertyNames.CenterColor)] public int CenterColor { get; set; } /// /// The color on the edges of the backdrop in RGB format /// [JsonPropertyName(PropertyNames.EdgeColor)] public int EdgeColor { get; set; } /// /// The color to be applied to the symbol in RGB format /// [JsonPropertyName(PropertyNames.SymbolColor)] public int SymbolColor { get; set; } /// /// The color for the text on the backdrop in RGB format /// [JsonPropertyName(PropertyNames.TextColor)] public int TextColor { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/UniqueGiftColors.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift. /// public class UniqueGiftColors { /// /// Custom emoji identifier of the unique gift's model /// [JsonPropertyName(PropertyNames.ModelCustomEmojiId)] public string ModelCustomEmojiId { get; set; } = null!; /// /// Custom emoji identifier of the unique gift's symbol /// [JsonPropertyName(PropertyNames.SymbolCustomEmojiId)] public string SymbolCustomEmojiId { get; set; } = null!; /// /// Main color used in light themes; RGB format /// [JsonPropertyName(PropertyNames.LightThemeMainColor)] public int LightThemeMainColor { get; set; } /// /// List of 1-3 additional colors used in light themes; RGB format /// [JsonPropertyName(PropertyNames.LightThemeOtherColors)] public IEnumerable LightThemeOtherColors { get; set; } = null!; /// /// Main color used in dark themes; RGB format /// [JsonPropertyName(PropertyNames.DarkThemeMainColor)] public int DarkThemeMainColor { get; set; } /// /// List of 1-3 additional colors used in dark themes; RGB format /// [JsonPropertyName(PropertyNames.DarkThemeOtherColors)] public IEnumerable DarkThemeOtherColors { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/UniqueGiftInfo.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// Describes a service message about a unique gift that was sent or received. /// public class UniqueGiftInfo { /// /// Information about the gift /// [JsonPropertyName(PropertyNames.Gift)] public UniqueGift Gift { get; set; } = null!; /// /// Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers /// [JsonPropertyName(PropertyNames.Origin)] public string Origin { get; set; } = null!; /// /// Optional. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins. /// [JsonPropertyName(PropertyNames.LastResaleCurrency)] public string? LastResaleCurrency { get; set; } /// /// Optional. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins /// [JsonPropertyName(PropertyNames.LastResaleAmount)] public int? LastResaleAmount { get; set; } /// /// Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts /// [JsonPropertyName(PropertyNames.OwnedGiftId)] public string? OwnedGiftId { get; set; } /// /// Optional. Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift /// [JsonPropertyName(PropertyNames.TransferStarCount)] public int? TransferStarCount { get; set; } /// /// Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now /// [JsonPropertyName(PropertyNames.NextTransferDate)] public int? NextTransferDate { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/UniqueGiftModel.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Stickers; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the model of a unique gift. /// public class UniqueGiftModel { /// /// Name of the model /// [JsonPropertyName(PropertyNames.Name)] public string Name { get; set; } = null!; /// /// The sticker that represents the unique gift /// [JsonPropertyName(PropertyNames.Sticker)] public Sticker Sticker { get; set; } = null!; /// /// The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts. /// [JsonPropertyName(PropertyNames.RarityPerMille)] public int RarityPerMille { get; set; } /// /// Optional. Rarity of the model if it is a crafted model. Currently, can be “uncommon”, “rare”, “epic”, or “legendary”. /// [JsonPropertyName(PropertyNames.Rarity)] public string? Rarity { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/UniqueGiftSymbol.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! using Telegram.BotAPI.Stickers; namespace Telegram.BotAPI.AvailableTypes; /// /// This object describes the symbol shown on the pattern of a unique gift. /// public class UniqueGiftSymbol { /// /// Name of the symbol /// [JsonPropertyName(PropertyNames.Name)] public string Name { get; set; } = null!; /// /// The sticker that represents the unique gift /// [JsonPropertyName(PropertyNames.Sticker)] public Sticker Sticker { get; set; } = null!; /// /// The number of unique gifts that receive this model for every 1000 gifts upgraded /// [JsonPropertyName(PropertyNames.RarityPerMille)] public int RarityPerMille { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/User.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a Telegram user or bot. /// public class User { /// /// Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. /// [JsonPropertyName(PropertyNames.Id)] public long Id { get; set; } /// /// True, if this user is a bot /// [JsonPropertyName(PropertyNames.IsBot)] public bool IsBot { get; set; } /// /// User's or bot's first name /// [JsonPropertyName(PropertyNames.FirstName)] public string FirstName { get; set; } = null!; /// /// Optional. User's or bot's last name /// [JsonPropertyName(PropertyNames.LastName)] public string? LastName { get; set; } /// /// Optional. User's or bot's username /// [JsonPropertyName(PropertyNames.Username)] public string? Username { get; set; } /// /// Optional. IETF language tag of the user's language /// [JsonPropertyName(PropertyNames.LanguageCode)] public string? LanguageCode { get; set; } /// /// Optional. True, if this user is a Telegram Premium user /// [JsonPropertyName(PropertyNames.IsPremium)] public bool? IsPremium { get; set; } /// /// Optional. True, if this user added the bot to the attachment menu /// [JsonPropertyName(PropertyNames.AddedToAttachmentMenu)] public bool? AddedToAttachmentMenu { get; set; } /// /// Optional. True, if the bot can be invited to groups. Returned only in getMe. /// [JsonPropertyName(PropertyNames.CanJoinGroups)] public bool? CanJoinGroups { get; set; } /// /// Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. /// [JsonPropertyName(PropertyNames.CanReadAllGroupMessages)] public bool? CanReadAllGroupMessages { get; set; } /// /// Optional. True, if the bot supports guest queries from chats it is not a member of. Returned only in getMe. /// [JsonPropertyName(PropertyNames.SupportsGuestQueries)] public bool? SupportsGuestQueries { get; set; } /// /// Optional. True, if the bot supports inline queries. Returned only in getMe. /// [JsonPropertyName(PropertyNames.SupportsInlineQueries)] public bool? SupportsInlineQueries { get; set; } /// /// Optional. True, if the bot can be connected to a user account to manage it. Returned only in getMe. /// [JsonPropertyName(PropertyNames.CanConnectToBusiness)] public bool? CanConnectToBusiness { get; set; } /// /// Optional. True, if the bot has a main Web App. Returned only in getMe. /// [JsonPropertyName(PropertyNames.HasMainWebApp)] public bool? HasMainWebApp { get; set; } /// /// Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe. /// [JsonPropertyName(PropertyNames.HasTopicsEnabled)] public bool? HasTopicsEnabled { get; set; } /// /// Optional. True, if the bot allows users to create and delete topics in private chats. Returned only in getMe. /// [JsonPropertyName(PropertyNames.AllowsUsersToCreateTopics)] public bool? AllowsUsersToCreateTopics { get; set; } /// /// Optional. True, if other bots can be created to be controlled by the bot. Returned only in getMe. /// [JsonPropertyName(PropertyNames.CanManageBots)] public bool? CanManageBots { get; set; } } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/UserChatBoosts.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents a list of boosts added to a chat by a user. /// public class UserChatBoosts { /// /// The list of boosts added to the chat by the user /// [JsonPropertyName(PropertyNames.Boosts)] public IEnumerable Boosts { get; set; } = null!; } ================================================ FILE: src/library/Telegram.BotAPI/AvailableTypes/UserProfileAudios.cs ================================================ // Copyright (c) 2026 Quetzal Rivera. // Licensed under the MIT License, See LICENCE in the project root for license information. //* This file is auto-generated. Don't edit it manually! namespace Telegram.BotAPI.AvailableTypes; /// /// This object represents the audios displayed on a user's profile. /// public class UserProfileAudios { /// /// Total number of profile audios for the target user /// [JsonPropertyName(PropertyNames.TotalCount)] public int TotalCount { get; set; } /// /// Requested profile audios /// [JsonPropertyName(PropertyNames.Audios)] public IEnumerable