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
================================================
|
|
Telegram.BotAPI
|
| -------------------------------------------------- | ------------------------ |
[](https://www.nuget.org/packages/Telegram.BotAPI/)
[](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.
[](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

## 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

## 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

## 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

## 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

## 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

## 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
[](https://www.nuget.org/packages/Telegram.BotAPI/)
[](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;
///