├── .clang-format ├── .github └── workflows │ ├── CI_format.yaml │ ├── CI_ubuntu.yaml │ ├── CI_windows.yaml │ └── delete_old_runs.yaml ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── benchmarks ├── CMakeLists.txt ├── bench_main.cpp ├── boost_parse_handler.hpp ├── files.cpp ├── fuzzing.hpp ├── handler_parser │ ├── all.hpp │ ├── basic_parser.hpp │ ├── box.hpp │ ├── common_api.hpp │ ├── disriminated_api.hpp │ ├── fundamental.hpp │ ├── ignore.hpp │ ├── oneof_field_api.hpp │ ├── optional.hpp │ └── range.hpp ├── rapid_parse_handler.hpp └── types.hpp ├── cmake ├── deps.cmake ├── generate.cmake └── get_cpm.cmake ├── examples ├── CMakeLists.txt ├── echo_audio_files │ ├── CMakeLists.txt │ └── main.cpp ├── echobot │ ├── CMakeLists.txt │ └── main.cpp ├── inline_keyboard │ ├── CMakeLists.txt │ └── main.cpp ├── photo │ ├── CMakeLists.txt │ ├── example_cat.jpg │ └── main.cpp └── test_main │ ├── CMakeLists.txt │ └── main.cpp ├── gtest ├── CMakeLists.txt ├── api │ ├── basic_types.cpp │ └── update.cpp ├── gtest_formater.hpp ├── http │ ├── connection_pool.cpp │ └── test_body.cpp ├── parsers │ ├── fixtures.hpp │ ├── test_array.cpp │ ├── test_basic.cpp │ ├── test_object.cpp │ ├── test_oneof.cpp │ ├── test_oneof_field.cpp │ ├── test_optional.cpp │ ├── test_stream.cpp │ └── test_tree.cpp └── utils.cpp ├── include └── tgbm │ ├── api │ ├── Integer.hpp │ ├── allowed_updates.hpp │ ├── arrayof.hpp │ ├── common.hpp │ ├── const_string.hpp │ ├── file_or_str.hpp │ ├── floating.hpp │ ├── input_file.hpp │ ├── int_or_str.hpp │ ├── methods │ │ ├── addStickerToSet.hpp │ │ ├── all.hpp │ │ ├── all_fwd.hpp │ │ ├── answerCallbackQuery.hpp │ │ ├── answerInlineQuery.hpp │ │ ├── answerPreCheckoutQuery.hpp │ │ ├── answerShippingQuery.hpp │ │ ├── answerWebAppQuery.hpp │ │ ├── approveChatJoinRequest.hpp │ │ ├── banChatMember.hpp │ │ ├── banChatSenderChat.hpp │ │ ├── close.hpp │ │ ├── closeForumTopic.hpp │ │ ├── closeGeneralForumTopic.hpp │ │ ├── convertGiftToStars.hpp │ │ ├── copyMessage.hpp │ │ ├── copyMessages.hpp │ │ ├── createChatInviteLink.hpp │ │ ├── createChatSubscriptionInviteLink.hpp │ │ ├── createForumTopic.hpp │ │ ├── createInvoiceLink.hpp │ │ ├── createNewStickerSet.hpp │ │ ├── declineChatJoinRequest.hpp │ │ ├── deleteBusinessMessages.hpp │ │ ├── deleteChatPhoto.hpp │ │ ├── deleteChatStickerSet.hpp │ │ ├── deleteForumTopic.hpp │ │ ├── deleteMessage.hpp │ │ ├── deleteMessages.hpp │ │ ├── deleteMyCommands.hpp │ │ ├── deleteStickerFromSet.hpp │ │ ├── deleteStickerSet.hpp │ │ ├── deleteStory.hpp │ │ ├── deleteWebhook.hpp │ │ ├── editChatInviteLink.hpp │ │ ├── editChatSubscriptionInviteLink.hpp │ │ ├── editForumTopic.hpp │ │ ├── editGeneralForumTopic.hpp │ │ ├── editMessageCaption.hpp │ │ ├── editMessageLiveLocation.hpp │ │ ├── editMessageMedia.hpp │ │ ├── editMessageReplyMarkup.hpp │ │ ├── editMessageText.hpp │ │ ├── editStory.hpp │ │ ├── editUserStarSubscription.hpp │ │ ├── exportChatInviteLink.hpp │ │ ├── forwardMessage.hpp │ │ ├── forwardMessages.hpp │ │ ├── getAvailableGifts.hpp │ │ ├── getBusinessAccountGifts.hpp │ │ ├── getBusinessAccountStarBalance.hpp │ │ ├── getBusinessConnection.hpp │ │ ├── getChat.hpp │ │ ├── getChatAdministrators.hpp │ │ ├── getChatMember.hpp │ │ ├── getChatMemberCount.hpp │ │ ├── getChatMenuButton.hpp │ │ ├── getCustomEmojiStickers.hpp │ │ ├── getFile.hpp │ │ ├── getForumTopicIconStickers.hpp │ │ ├── getGameHighScores.hpp │ │ ├── getMe.hpp │ │ ├── getMyCommands.hpp │ │ ├── getMyDefaultAdministratorRights.hpp │ │ ├── getMyDescription.hpp │ │ ├── getMyName.hpp │ │ ├── getMyShortDescription.hpp │ │ ├── getStarTransactions.hpp │ │ ├── getStickerSet.hpp │ │ ├── getUpdates.hpp │ │ ├── getUserChatBoosts.hpp │ │ ├── getUserProfilePhotos.hpp │ │ ├── getWebhookInfo.hpp │ │ ├── giftPremiumSubscription.hpp │ │ ├── hideGeneralForumTopic.hpp │ │ ├── leaveChat.hpp │ │ ├── logOut.hpp │ │ ├── pinChatMessage.hpp │ │ ├── postStory.hpp │ │ ├── promoteChatMember.hpp │ │ ├── readBusinessMessage.hpp │ │ ├── refundStarPayment.hpp │ │ ├── removeBusinessAccountProfilePhoto.hpp │ │ ├── removeChatVerification.hpp │ │ ├── removeUserVerification.hpp │ │ ├── reopenForumTopic.hpp │ │ ├── reopenGeneralForumTopic.hpp │ │ ├── replaceStickerInSet.hpp │ │ ├── restrictChatMember.hpp │ │ ├── revokeChatInviteLink.hpp │ │ ├── savePreparedInlineMessage.hpp │ │ ├── sendAnimation.hpp │ │ ├── sendAudio.hpp │ │ ├── sendChatAction.hpp │ │ ├── sendContact.hpp │ │ ├── sendDice.hpp │ │ ├── sendDocument.hpp │ │ ├── sendGame.hpp │ │ ├── sendGift.hpp │ │ ├── sendInvoice.hpp │ │ ├── sendLocation.hpp │ │ ├── sendMediaGroup.hpp │ │ ├── sendMessage.hpp │ │ ├── sendPaidMedia.hpp │ │ ├── sendPhoto.hpp │ │ ├── sendPoll.hpp │ │ ├── sendSticker.hpp │ │ ├── sendVenue.hpp │ │ ├── sendVideo.hpp │ │ ├── sendVideoNote.hpp │ │ ├── sendVoice.hpp │ │ ├── setBusinessAccountBio.hpp │ │ ├── setBusinessAccountGiftSettings.hpp │ │ ├── setBusinessAccountName.hpp │ │ ├── setBusinessAccountProfilePhoto.hpp │ │ ├── setBusinessAccountUsername.hpp │ │ ├── setChatAdministratorCustomTitle.hpp │ │ ├── setChatDescription.hpp │ │ ├── setChatMenuButton.hpp │ │ ├── setChatPermissions.hpp │ │ ├── setChatPhoto.hpp │ │ ├── setChatStickerSet.hpp │ │ ├── setChatTitle.hpp │ │ ├── setCustomEmojiStickerSetThumbnail.hpp │ │ ├── setGameScore.hpp │ │ ├── setMessageReaction.hpp │ │ ├── setMyCommands.hpp │ │ ├── setMyDefaultAdministratorRights.hpp │ │ ├── setMyDescription.hpp │ │ ├── setMyName.hpp │ │ ├── setMyShortDescription.hpp │ │ ├── setPassportDataErrors.hpp │ │ ├── setStickerEmojiList.hpp │ │ ├── setStickerKeywords.hpp │ │ ├── setStickerMaskPosition.hpp │ │ ├── setStickerPositionInSet.hpp │ │ ├── setStickerSetThumbnail.hpp │ │ ├── setStickerSetTitle.hpp │ │ ├── setUserEmojiStatus.hpp │ │ ├── setWebhook.hpp │ │ ├── stopMessageLiveLocation.hpp │ │ ├── stopPoll.hpp │ │ ├── transferBusinessAccountStars.hpp │ │ ├── transferGift.hpp │ │ ├── unbanChatMember.hpp │ │ ├── unbanChatSenderChat.hpp │ │ ├── unhideGeneralForumTopic.hpp │ │ ├── unpinAllChatMessages.hpp │ │ ├── unpinAllForumTopicMessages.hpp │ │ ├── unpinAllGeneralForumTopicMessages.hpp │ │ ├── unpinChatMessage.hpp │ │ ├── upgradeGift.hpp │ │ ├── uploadStickerFile.hpp │ │ ├── verifyChat.hpp │ │ └── verifyUser.hpp │ ├── oneof.hpp │ ├── optional.hpp │ ├── reply_markup.hpp │ ├── requests.hpp │ ├── telegram.hpp │ ├── telegram_answer.hpp │ ├── true.hpp │ └── types │ │ ├── AcceptedGiftTypes.hpp │ │ ├── AffiliateInfo.hpp │ │ ├── Animation.hpp │ │ ├── Audio.hpp │ │ ├── BackgroundFill.hpp │ │ ├── BackgroundFillFreeformGradient.hpp │ │ ├── BackgroundFillGradient.hpp │ │ ├── BackgroundFillSolid.hpp │ │ ├── BackgroundType.hpp │ │ ├── BackgroundTypeChatTheme.hpp │ │ ├── BackgroundTypeFill.hpp │ │ ├── BackgroundTypePattern.hpp │ │ ├── BackgroundTypeWallpaper.hpp │ │ ├── Birthdate.hpp │ │ ├── BotCommand.hpp │ │ ├── BotCommandScope.hpp │ │ ├── BotCommandScopeAllChatAdministrators.hpp │ │ ├── BotCommandScopeAllGroupChats.hpp │ │ ├── BotCommandScopeAllPrivateChats.hpp │ │ ├── BotCommandScopeChat.hpp │ │ ├── BotCommandScopeChatAdministrators.hpp │ │ ├── BotCommandScopeChatMember.hpp │ │ ├── BotCommandScopeDefault.hpp │ │ ├── BotDescription.hpp │ │ ├── BotName.hpp │ │ ├── BotShortDescription.hpp │ │ ├── BusinessBotRights.hpp │ │ ├── BusinessConnection.hpp │ │ ├── BusinessIntro.hpp │ │ ├── BusinessLocation.hpp │ │ ├── BusinessMessagesDeleted.hpp │ │ ├── BusinessOpeningHours.hpp │ │ ├── BusinessOpeningHoursInterval.hpp │ │ ├── CallbackGame.hpp │ │ ├── CallbackQuery.hpp │ │ ├── Chat.hpp │ │ ├── ChatAdministratorRights.hpp │ │ ├── ChatBackground.hpp │ │ ├── ChatBoost.hpp │ │ ├── ChatBoostAdded.hpp │ │ ├── ChatBoostRemoved.hpp │ │ ├── ChatBoostSource.hpp │ │ ├── ChatBoostSourceGiftCode.hpp │ │ ├── ChatBoostSourceGiveaway.hpp │ │ ├── ChatBoostSourcePremium.hpp │ │ ├── ChatBoostUpdated.hpp │ │ ├── ChatFullInfo.hpp │ │ ├── ChatInviteLink.hpp │ │ ├── ChatJoinRequest.hpp │ │ ├── ChatLocation.hpp │ │ ├── ChatMember.hpp │ │ ├── ChatMemberAdministrator.hpp │ │ ├── ChatMemberBanned.hpp │ │ ├── ChatMemberLeft.hpp │ │ ├── ChatMemberMember.hpp │ │ ├── ChatMemberOwner.hpp │ │ ├── ChatMemberRestricted.hpp │ │ ├── ChatMemberUpdated.hpp │ │ ├── ChatPermissions.hpp │ │ ├── ChatPhoto.hpp │ │ ├── ChatShared.hpp │ │ ├── ChosenInlineResult.hpp │ │ ├── Contact.hpp │ │ ├── CopyTextButton.hpp │ │ ├── Dice.hpp │ │ ├── Document.hpp │ │ ├── EncryptedCredentials.hpp │ │ ├── EncryptedPassportElement.hpp │ │ ├── ExternalReplyInfo.hpp │ │ ├── File.hpp │ │ ├── ForceReply.hpp │ │ ├── ForumTopic.hpp │ │ ├── ForumTopicClosed.hpp │ │ ├── ForumTopicCreated.hpp │ │ ├── ForumTopicEdited.hpp │ │ ├── ForumTopicReopened.hpp │ │ ├── Game.hpp │ │ ├── GameHighScore.hpp │ │ ├── GeneralForumTopicHidden.hpp │ │ ├── GeneralForumTopicUnhidden.hpp │ │ ├── Gift.hpp │ │ ├── GiftInfo.hpp │ │ ├── Gifts.hpp │ │ ├── Giveaway.hpp │ │ ├── GiveawayCompleted.hpp │ │ ├── GiveawayCreated.hpp │ │ ├── GiveawayWinners.hpp │ │ ├── InaccessibleMessage.hpp │ │ ├── InlineKeyboardButton.hpp │ │ ├── InlineKeyboardMarkup.hpp │ │ ├── InlineQuery.hpp │ │ ├── InlineQueryResult.hpp │ │ ├── InlineQueryResultArticle.hpp │ │ ├── InlineQueryResultAudio.hpp │ │ ├── InlineQueryResultCachedAudio.hpp │ │ ├── InlineQueryResultCachedDocument.hpp │ │ ├── InlineQueryResultCachedGif.hpp │ │ ├── InlineQueryResultCachedMpeg4Gif.hpp │ │ ├── InlineQueryResultCachedPhoto.hpp │ │ ├── InlineQueryResultCachedSticker.hpp │ │ ├── InlineQueryResultCachedVideo.hpp │ │ ├── InlineQueryResultCachedVoice.hpp │ │ ├── InlineQueryResultContact.hpp │ │ ├── InlineQueryResultDocument.hpp │ │ ├── InlineQueryResultGame.hpp │ │ ├── InlineQueryResultGif.hpp │ │ ├── InlineQueryResultLocation.hpp │ │ ├── InlineQueryResultMpeg4Gif.hpp │ │ ├── InlineQueryResultPhoto.hpp │ │ ├── InlineQueryResultVenue.hpp │ │ ├── InlineQueryResultVideo.hpp │ │ ├── InlineQueryResultVoice.hpp │ │ ├── InlineQueryResultsButton.hpp │ │ ├── InputContactMessageContent.hpp │ │ ├── InputFile.hpp │ │ ├── InputInvoiceMessageContent.hpp │ │ ├── InputLocationMessageContent.hpp │ │ ├── InputMedia.hpp │ │ ├── InputMediaAnimation.hpp │ │ ├── InputMediaAudio.hpp │ │ ├── InputMediaDocument.hpp │ │ ├── InputMediaPhoto.hpp │ │ ├── InputMediaVideo.hpp │ │ ├── InputMessageContent.hpp │ │ ├── InputPaidMedia.hpp │ │ ├── InputPaidMediaPhoto.hpp │ │ ├── InputPaidMediaVideo.hpp │ │ ├── InputPollOption.hpp │ │ ├── InputProfilePhoto.hpp │ │ ├── InputProfilePhotoAnimated.hpp │ │ ├── InputProfilePhotoStatic.hpp │ │ ├── InputSticker.hpp │ │ ├── InputStoryContent.hpp │ │ ├── InputStoryContentPhoto.hpp │ │ ├── InputStoryContentVideo.hpp │ │ ├── InputTextMessageContent.hpp │ │ ├── InputVenueMessageContent.hpp │ │ ├── Invoice.hpp │ │ ├── KeyboardButton.hpp │ │ ├── KeyboardButtonPollType.hpp │ │ ├── KeyboardButtonRequestChat.hpp │ │ ├── KeyboardButtonRequestUsers.hpp │ │ ├── LabeledPrice.hpp │ │ ├── LinkPreviewOptions.hpp │ │ ├── Location.hpp │ │ ├── LocationAddress.hpp │ │ ├── LoginUrl.hpp │ │ ├── MaskPosition.hpp │ │ ├── MaybeInaccessibleMessage.hpp │ │ ├── MenuButton.hpp │ │ ├── MenuButtonCommands.hpp │ │ ├── MenuButtonDefault.hpp │ │ ├── MenuButtonWebApp.hpp │ │ ├── Message.hpp │ │ ├── MessageAutoDeleteTimerChanged.hpp │ │ ├── MessageEntity.hpp │ │ ├── MessageId.hpp │ │ ├── MessageOrigin.hpp │ │ ├── MessageOriginChannel.hpp │ │ ├── MessageOriginChat.hpp │ │ ├── MessageOriginHiddenUser.hpp │ │ ├── MessageOriginUser.hpp │ │ ├── MessageReactionCountUpdated.hpp │ │ ├── MessageReactionUpdated.hpp │ │ ├── OrderInfo.hpp │ │ ├── OwnedGift.hpp │ │ ├── OwnedGiftRegular.hpp │ │ ├── OwnedGiftUnique.hpp │ │ ├── OwnedGifts.hpp │ │ ├── PaidMedia.hpp │ │ ├── PaidMediaInfo.hpp │ │ ├── PaidMediaPhoto.hpp │ │ ├── PaidMediaPreview.hpp │ │ ├── PaidMediaPurchased.hpp │ │ ├── PaidMediaVideo.hpp │ │ ├── PaidMessagePriceChanged.hpp │ │ ├── PassportData.hpp │ │ ├── PassportElementError.hpp │ │ ├── PassportElementErrorDataField.hpp │ │ ├── PassportElementErrorFile.hpp │ │ ├── PassportElementErrorFiles.hpp │ │ ├── PassportElementErrorFrontSide.hpp │ │ ├── PassportElementErrorReverseSide.hpp │ │ ├── PassportElementErrorSelfie.hpp │ │ ├── PassportElementErrorTranslationFile.hpp │ │ ├── PassportElementErrorTranslationFiles.hpp │ │ ├── PassportElementErrorUnspecified.hpp │ │ ├── PassportFile.hpp │ │ ├── PhotoSize.hpp │ │ ├── Poll.hpp │ │ ├── PollAnswer.hpp │ │ ├── PollOption.hpp │ │ ├── PreCheckoutQuery.hpp │ │ ├── PreparedInlineMessage.hpp │ │ ├── ProximityAlertTriggered.hpp │ │ ├── ReactionCount.hpp │ │ ├── ReactionType.hpp │ │ ├── ReactionTypeCustomEmoji.hpp │ │ ├── ReactionTypeEmoji.hpp │ │ ├── ReactionTypePaid.hpp │ │ ├── RefundedPayment.hpp │ │ ├── ReplyKeyboardMarkup.hpp │ │ ├── ReplyKeyboardRemove.hpp │ │ ├── ReplyParameters.hpp │ │ ├── ResponseParameters.hpp │ │ ├── RevenueWithdrawalState.hpp │ │ ├── RevenueWithdrawalStateFailed.hpp │ │ ├── RevenueWithdrawalStatePending.hpp │ │ ├── RevenueWithdrawalStateSucceeded.hpp │ │ ├── SentWebAppMessage.hpp │ │ ├── SharedUser.hpp │ │ ├── ShippingAddress.hpp │ │ ├── ShippingOption.hpp │ │ ├── ShippingQuery.hpp │ │ ├── StarAmount.hpp │ │ ├── StarTransaction.hpp │ │ ├── StarTransactions.hpp │ │ ├── Sticker.hpp │ │ ├── StickerSet.hpp │ │ ├── Story.hpp │ │ ├── StoryArea.hpp │ │ ├── StoryAreaPosition.hpp │ │ ├── StoryAreaType.hpp │ │ ├── StoryAreaTypeLink.hpp │ │ ├── StoryAreaTypeLocation.hpp │ │ ├── StoryAreaTypeSuggestedReaction.hpp │ │ ├── StoryAreaTypeUniqueGift.hpp │ │ ├── StoryAreaTypeWeather.hpp │ │ ├── SuccessfulPayment.hpp │ │ ├── SwitchInlineQueryChosenChat.hpp │ │ ├── TextQuote.hpp │ │ ├── TransactionPartner.hpp │ │ ├── TransactionPartnerAffiliateProgram.hpp │ │ ├── TransactionPartnerChat.hpp │ │ ├── TransactionPartnerFragment.hpp │ │ ├── TransactionPartnerOther.hpp │ │ ├── TransactionPartnerTelegramAds.hpp │ │ ├── TransactionPartnerTelegramApi.hpp │ │ ├── TransactionPartnerUser.hpp │ │ ├── UniqueGift.hpp │ │ ├── UniqueGiftBackdrop.hpp │ │ ├── UniqueGiftBackdropColors.hpp │ │ ├── UniqueGiftInfo.hpp │ │ ├── UniqueGiftModel.hpp │ │ ├── UniqueGiftSymbol.hpp │ │ ├── Update.hpp │ │ ├── User.hpp │ │ ├── UserChatBoosts.hpp │ │ ├── UserProfilePhotos.hpp │ │ ├── UsersShared.hpp │ │ ├── Venue.hpp │ │ ├── Video.hpp │ │ ├── VideoChatEnded.hpp │ │ ├── VideoChatParticipantsInvited.hpp │ │ ├── VideoChatScheduled.hpp │ │ ├── VideoChatStarted.hpp │ │ ├── VideoNote.hpp │ │ ├── Voice.hpp │ │ ├── WebAppData.hpp │ │ ├── WebAppInfo.hpp │ │ ├── WebhookInfo.hpp │ │ ├── WriteAccessAllowed.hpp │ │ ├── all.hpp │ │ └── all_fwd.hpp │ ├── bot.hpp │ ├── json.hpp │ ├── jsons │ ├── boostjson_dom_traits.hpp │ ├── boostjson_sax_producer.hpp │ ├── boostjson_serialize_dom.hpp │ ├── dom_parser.hpp │ ├── dom_traits.hpp │ ├── errors.hpp │ ├── parse_dom │ │ ├── array.hpp │ │ ├── basic.hpp │ │ ├── common_api.hpp │ │ ├── discriminated_api.hpp │ │ ├── fundamental.hpp │ │ ├── oneof_field_api_type.hpp │ │ └── optional.hpp │ ├── parse_sax │ │ ├── common_api.hpp │ │ ├── discriminated_api.hpp │ │ ├── fundamental.hpp │ │ ├── oneof_field_api_type.hpp │ │ ├── optional_parser.hpp │ │ └── vector_parser.hpp │ ├── rapidjson_dom_traits.hpp │ ├── rapidjson_serialize_sax.hpp │ ├── sax.hpp │ ├── sax_parser.hpp │ └── stream_parser.hpp │ ├── logger.hpp │ ├── long_poll.hpp │ ├── net │ ├── any_acceptor.hpp │ ├── any_connection.hpp │ ├── asio │ │ ├── asio_awaiters.hpp │ │ ├── asio_tls_transport.hpp │ │ ├── asio_transport.hpp │ │ ├── ssl_context.hpp │ │ └── tcp_connection.hpp │ ├── errors.hpp │ ├── http11 │ │ ├── client.hpp │ │ └── connection_pool.hpp │ ├── http2 │ │ ├── client.hpp │ │ ├── errors.hpp │ │ ├── protocol.hpp │ │ └── server.hpp │ ├── http_base.hpp │ ├── http_body.hpp │ ├── http_body_builders.hpp │ ├── http_client.hpp │ ├── http_client_with_retry.hpp │ └── transport_factory.hpp │ └── utils │ ├── algorithm.hpp │ ├── anyany_utils.hpp │ ├── api_utils.hpp │ ├── boost_intrusive.hpp │ ├── box.hpp │ ├── box_union.hpp │ ├── constexpr_string.hpp │ ├── deadline.hpp │ ├── fn_ref.hpp │ ├── formatters.hpp │ ├── macro.hpp │ ├── math.hpp │ ├── memory.hpp │ ├── meta.hpp │ ├── parse_proxy.hpp │ ├── pfr_extension.hpp │ ├── reusable_buffer.hpp │ ├── scope_exit.hpp │ ├── string_switch.hpp │ ├── traits.hpp │ ├── url_encoded.hpp │ └── zero_movable.hpp ├── scripts ├── ci_ubuntu.make ├── presets_ubuntu-24.04.json ├── presets_windows.json ├── tgapi_methods.py └── tgapi_types.py ├── src ├── api │ └── input_file.cpp ├── bot.cpp ├── long_poll.cpp ├── net │ ├── asio_tls_transport.cpp │ ├── asio_transport.cpp │ ├── http11 │ │ └── client.cpp │ ├── http2 │ │ ├── client.cpp │ │ ├── protocol.cpp │ │ └── server.cpp │ ├── http_client.cpp │ ├── ssl_context.cpp │ ├── tcp_connection.cpp │ └── transport_factory.cpp ├── telegram.cpp └── utils │ └── url_encoded.cpp └── test ├── CMakeLists.txt ├── client_smoke_no_tls.cpp ├── fake_server.cpp ├── server_client_smoke.cpp ├── test_http2_frames.cpp ├── test_server.crt └── test_server.key /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: Google 2 | ColumnLimit : 110 3 | AllowShortFunctionsOnASingleLine: false 4 | AllowShortLambdasOnASingleLine: true 5 | AllowShortIfStatementsOnASingleLine: false 6 | AllowShortLoopsOnASingleLine: false 7 | SortIncludes: false 8 | DerivePointerAlignment: false # disables 'Google' option which forces ignoring my rules 9 | PointerAlignment: Left 10 | ReferenceAlignment: Left 11 | InsertNewlineAtEOF: true 12 | IndentPPDirectives: BeforeHash 13 | -------------------------------------------------------------------------------- /.github/workflows/CI_format.yaml: -------------------------------------------------------------------------------- 1 | name: format_check 2 | 3 | permissions: 4 | actions: write 5 | contents: read 6 | 7 | 'on': 8 | pull_request: 9 | push: 10 | branches: 11 | - master 12 | 13 | env: 14 | UBSAN_OPTIONS: print_stacktrace=1 15 | 16 | jobs: 17 | format_check: 18 | strategy: 19 | fail-fast: false 20 | 21 | name: 'format_check' 22 | runs-on: ubuntu-24.04 23 | 24 | steps: 25 | - name: Cancel Previous Runs 26 | uses: styfle/cancel-workflow-action@0.9.1 27 | 28 | - name: Checkout the code 29 | uses: actions/checkout@v4 30 | 31 | - name: Install clang-format 32 | run: | 33 | sudo make -f scripts/ci_ubuntu.make install-compiler compiler=clang version=19 34 | - name: Format 35 | run: > 36 | sudo make 37 | -f scripts/ci_ubuntu.make 38 | format 39 | 40 | - name: Check if all files are committed to git 41 | run: > 42 | sudo make 43 | -f scripts/ci_ubuntu.make 44 | check-git-status 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | CMakeCache.txt 2 | CMakeFiles 3 | CMakeSettings.json 4 | Makefile 5 | install_manifest.txt 6 | *.cbp 7 | *.a 8 | *.so 9 | *.lnk 10 | .sw 11 | doc/ 12 | Thumbs.db 13 | .idea/ 14 | docs/ 15 | cmake-build-* 16 | cmake_build 17 | .cache 18 | 19 | src/api_types_cmp.cpp 20 | 21 | .vs/ 22 | .vscode/ 23 | .trash/ 24 | build/ 25 | out/ 26 | 27 | 28 | build* 29 | test.log 30 | 31 | .DS_Store 32 | vcpkg_installed 33 | compile_commands.json 34 | CMakePresets.json 35 | 36 | -------------------------------------------------------------------------------- /benchmarks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(${PROJECT_NAME}_gbenchs 2 | files.cpp 3 | bench_main.cpp 4 | ) 5 | 6 | target_compile_options(${PROJECT_NAME}_gbenchs 7 | PUBLIC 8 | "-Wno-undefined-var-template" 9 | "-Wno-reorder-init-list" 10 | ) 11 | 12 | target_link_libraries(${PROJECT_NAME}_gbenchs 13 | PUBLIC tgbmlib benchmark::benchmark 14 | ) 15 | 16 | target_include_directories( 17 | ${PROJECT_NAME}_gbenchs PRIVATE 18 | ${CMAKE_CURRENT_SOURCE_DIR} 19 | ) 20 | 21 | set_target_properties(${PROJECT_NAME}_gbenchs PROPERTIES 22 | CMAKE_CXX_EXTENSIONS OFF 23 | LINKER_LANGUAGE CXX 24 | CMAKE_CXX_STANDARD_REQUIRED ON 25 | CXX_STANDARD 20 26 | ) 27 | -------------------------------------------------------------------------------- /benchmarks/handler_parser/all.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "basic_parser.hpp" 4 | #include "box.hpp" 5 | #include "common_api.hpp" 6 | #include "disriminated_api.hpp" 7 | #include "fundamental.hpp" 8 | #include "ignore.hpp" 9 | #include "optional.hpp" 10 | #include "range.hpp" 11 | #include "oneof_field_api.hpp" 12 | -------------------------------------------------------------------------------- /cmake/get_cpm.cmake: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | # 3 | # SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors 4 | 5 | set(CPM_DOWNLOAD_VERSION 0.40.2) 6 | set(CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d") 7 | 8 | if(CPM_SOURCE_CACHE) 9 | set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") 10 | elseif(DEFINED ENV{CPM_SOURCE_CACHE}) 11 | set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") 12 | else() 13 | set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") 14 | endif() 15 | 16 | # Expand relative path. This is important if the provided path contains a tilde (~) 17 | get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) 18 | 19 | file(DOWNLOAD 20 | https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake 21 | ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} 22 | ) 23 | 24 | include(${CPM_DOWNLOAD_LOCATION}) 25 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(echobot) 2 | add_subdirectory(photo) 3 | add_subdirectory(echo_audio_files) 4 | add_subdirectory(inline_keyboard) 5 | add_subdirectory(test_main) 6 | 7 | -------------------------------------------------------------------------------- /examples/echo_audio_files/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | project(echo_audio_files) 4 | 5 | add_executable(echo_audio_files ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) 6 | 7 | target_link_libraries(echo_audio_files PRIVATE tgbmlib) 8 | 9 | set_target_properties(echo_audio_files PROPERTIES CXX_STANDARD 20) 10 | -------------------------------------------------------------------------------- /examples/echobot/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | project(echobot) 4 | 5 | add_executable(echobot ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) 6 | 7 | target_link_libraries(echobot PRIVATE tgbmlib) 8 | 9 | set_target_properties(echobot PROPERTIES CXX_STANDARD 20) 10 | -------------------------------------------------------------------------------- /examples/inline_keyboard/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | project(inline_keyboard) 4 | 5 | add_executable(inline_keyboard ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) 6 | 7 | target_link_libraries(inline_keyboard PRIVATE tgbmlib) 8 | 9 | set_target_properties(inline_keyboard PROPERTIES CXX_STANDARD 20) 10 | -------------------------------------------------------------------------------- /examples/photo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | project(photo) 4 | 5 | add_executable(photo ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) 6 | 7 | target_link_libraries(photo PRIVATE tgbmlib) 8 | 9 | set_target_properties(photo PROPERTIES CXX_STANDARD 20) 10 | target_compile_definitions(photo PRIVATE EXAMPLE_PHOTO_PATH="${CMAKE_CURRENT_SOURCE_DIR}/example_cat.jpg") 11 | -------------------------------------------------------------------------------- /examples/photo/example_cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bot-motherlib/TGBM/1b80a1e885492902bbb388644121db29337831bb/examples/photo/example_cat.jpg -------------------------------------------------------------------------------- /examples/test_main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | project(test_main) 4 | 5 | add_executable(test_main ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) 6 | 7 | target_link_libraries(test_main PRIVATE tgbmlib) 8 | 9 | set_target_properties(test_main PROPERTIES CXX_STANDARD 20) 10 | -------------------------------------------------------------------------------- /gtest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(GoogleTest) 2 | 3 | add_executable(${PROJECT_NAME}_gtests 4 | api/basic_types.cpp 5 | api/update.cpp 6 | parsers/test_basic.cpp 7 | parsers/test_tree.cpp 8 | parsers/test_optional.cpp 9 | parsers/test_object.cpp 10 | parsers/test_array.cpp 11 | parsers/test_oneof.cpp 12 | parsers/test_oneof_field.cpp 13 | parsers/test_stream.cpp 14 | http/test_body.cpp 15 | http/connection_pool.cpp 16 | utils.cpp 17 | ) 18 | 19 | target_compile_options(${PROJECT_NAME}_gtests 20 | PUBLIC 21 | "-Wno-undefined-var-template" 22 | "-Wno-reorder-init-list" 23 | "-g" 24 | ) 25 | 26 | target_link_libraries(${PROJECT_NAME}_gtests 27 | PUBLIC tgbmlib 28 | GTest::gtest 29 | GTest::gtest_main 30 | ) 31 | target_include_directories( 32 | ${PROJECT_NAME}_gtests PRIVATE 33 | ${CMAKE_CURRENT_SOURCE_DIR} 34 | ) 35 | 36 | set_target_properties(${PROJECT_NAME}_gtests PROPERTIES 37 | CMAKE_CXX_EXTENSIONS OFF 38 | LINKER_LANGUAGE CXX 39 | CMAKE_CXX_STANDARD_REQUIRED ON 40 | CXX_STANDARD 20 41 | ) 42 | 43 | add_test(TGBM_gtests tgbm_gtests) 44 | -------------------------------------------------------------------------------- /gtest/gtest_formater.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | #include 8 | 9 | template 10 | concept formattable = fmt::is_formattable::value; 11 | 12 | namespace std { 13 | 14 | template 15 | void PrintTo(const T& t, std::ostream* os) { 16 | fmt::format_to(std::ostreambuf_iterator(*os), "{}", t); 17 | } 18 | } // namespace std 19 | -------------------------------------------------------------------------------- /include/tgbm/api/arrayof.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | template 8 | using arrayof = std::vector; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /include/tgbm/api/common.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | namespace tgbm::api { 25 | 26 | enum struct file_info_e { 27 | yes, 28 | no, 29 | maybe, 30 | }; 31 | 32 | using String = std::string; 33 | 34 | } // namespace tgbm::api 35 | -------------------------------------------------------------------------------- /include/tgbm/api/input_file.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct InputFile { 9 | std::string filename; 10 | std::string mimetype; 11 | std::string data; 12 | 13 | static InputFile from_file(std::filesystem::path file_path, std::string mime_type); 14 | }; 15 | 16 | } // namespace tgbm::api 17 | -------------------------------------------------------------------------------- /include/tgbm/api/int_or_str.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace tgbm::api { 8 | 9 | using int_or_str = std::variant; 10 | 11 | } // namespace tgbm::api 12 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/addStickerToSet.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct add_sticker_to_set_request { 9 | /* User identifier of sticker set owner */ 10 | Integer user_id; 11 | /* Sticker set name */ 12 | String name; 13 | /* A JSON-serialized object with information about the added sticker. If exactly the same sticker had 14 | * already been added to the set, then the set isn't changed. */ 15 | box sticker; 16 | 17 | using return_type = bool; 18 | static constexpr file_info_e file_info = file_info_e::no; 19 | static constexpr std::string_view api_method_name = "addStickerToSet"; 20 | static constexpr http_method_e http_method = http_method_e::POST; 21 | 22 | void fill_nonfile_args(auto& body) const { 23 | body.arg("user_id", user_id); 24 | body.arg("name", name); 25 | body.arg("sticker", sticker); 26 | } 27 | }; 28 | 29 | } // namespace tgbm::api 30 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/answerWebAppQuery.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace tgbm::api { 8 | 9 | struct answer_web_app_query_request { 10 | /* Unique identifier for the query to be answered */ 11 | String web_app_query_id; 12 | /* A JSON-serialized object describing the message to be sent */ 13 | box result; 14 | 15 | using return_type = SentWebAppMessage; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "answerWebAppQuery"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | body.arg("web_app_query_id", web_app_query_id); 22 | body.arg("result", result); 23 | } 24 | }; 25 | 26 | } // namespace tgbm::api 27 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/approveChatJoinRequest.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct approve_chat_join_request_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | /* Unique identifier of the target user */ 12 | Integer user_id; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "approveChatJoinRequest"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("user_id", user_id); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/banChatSenderChat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct ban_chat_sender_chat_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | /* Unique identifier of the target sender chat */ 12 | Integer sender_chat_id; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "banChatSenderChat"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("sender_chat_id", sender_chat_id); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/close.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct close_request { 8 | using return_type = bool; 9 | static constexpr file_info_e file_info = file_info_e::no; 10 | static constexpr std::string_view api_method_name = "close"; 11 | static constexpr http_method_e http_method = http_method_e::GET; 12 | }; 13 | 14 | } // namespace tgbm::api 15 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/closeForumTopic.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct close_forum_topic_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | /* Unique identifier for the target message thread of the forum topic */ 12 | Integer message_thread_id; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "closeForumTopic"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("message_thread_id", message_thread_id); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/closeGeneralForumTopic.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct close_general_forum_topic_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | 12 | using return_type = bool; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "closeGeneralForumTopic"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("chat_id", chat_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/convertGiftToStars.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct convert_gift_to_stars_request { 8 | /* Unique identifier of the business connection */ 9 | String business_connection_id; 10 | /* Unique identifier of the regular gift that should be converted to Telegram Stars */ 11 | String owned_gift_id; 12 | 13 | using return_type = bool; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "convertGiftToStars"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | body.arg("business_connection_id", business_connection_id); 20 | body.arg("owned_gift_id", owned_gift_id); 21 | } 22 | }; 23 | 24 | } // namespace tgbm::api 25 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/declineChatJoinRequest.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct decline_chat_join_request_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | /* Unique identifier of the target user */ 12 | Integer user_id; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "declineChatJoinRequest"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("user_id", user_id); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/deleteBusinessMessages.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct delete_business_messages_request { 8 | /* Unique identifier of the business connection on behalf of which to delete the messages */ 9 | String business_connection_id; 10 | /* A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same 11 | * chat. See deleteMessage for limitations on which messages can be deleted */ 12 | arrayof message_ids; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "deleteBusinessMessages"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("business_connection_id", business_connection_id); 21 | body.arg("message_ids", message_ids); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/deleteChatPhoto.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct delete_chat_photo_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | 12 | using return_type = bool; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "deleteChatPhoto"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("chat_id", chat_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/deleteChatStickerSet.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct delete_chat_sticker_set_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | 12 | using return_type = bool; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "deleteChatStickerSet"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("chat_id", chat_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/deleteForumTopic.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct delete_forum_topic_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | /* Unique identifier for the target message thread of the forum topic */ 12 | Integer message_thread_id; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "deleteForumTopic"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("message_thread_id", message_thread_id); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/deleteMessage.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct delete_message_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | /* Identifier of the message to delete */ 12 | Integer message_id; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "deleteMessage"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("message_id", message_id); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/deleteMessages.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct delete_messages_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | /* A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on 12 | * which messages can be deleted */ 13 | arrayof message_ids; 14 | 15 | using return_type = bool; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "deleteMessages"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | body.arg("chat_id", chat_id); 22 | body.arg("message_ids", message_ids); 23 | } 24 | }; 25 | 26 | } // namespace tgbm::api 27 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/deleteMyCommands.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct delete_my_commands_request { 9 | /* A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to 10 | * BotCommandScopeDefault. */ 11 | box scope; 12 | /* A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given 13 | * scope, for whose language there are no dedicated commands */ 14 | optional language_code; 15 | 16 | using return_type = bool; 17 | static constexpr file_info_e file_info = file_info_e::no; 18 | static constexpr std::string_view api_method_name = "deleteMyCommands"; 19 | static constexpr http_method_e http_method = http_method_e::POST; 20 | 21 | void fill_nonfile_args(auto& body) const { 22 | if (scope) 23 | body.arg("scope", *scope); 24 | if (language_code) 25 | body.arg("language_code", *language_code); 26 | } 27 | }; 28 | 29 | } // namespace tgbm::api 30 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/deleteStickerFromSet.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct delete_sticker_from_set_request { 8 | /* File identifier of the sticker */ 9 | String sticker; 10 | 11 | using return_type = bool; 12 | static constexpr file_info_e file_info = file_info_e::no; 13 | static constexpr std::string_view api_method_name = "deleteStickerFromSet"; 14 | static constexpr http_method_e http_method = http_method_e::POST; 15 | 16 | void fill_nonfile_args(auto& body) const { 17 | body.arg("sticker", sticker); 18 | } 19 | }; 20 | 21 | } // namespace tgbm::api 22 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/deleteStickerSet.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct delete_sticker_set_request { 8 | /* Sticker set name */ 9 | String name; 10 | 11 | using return_type = bool; 12 | static constexpr file_info_e file_info = file_info_e::no; 13 | static constexpr std::string_view api_method_name = "deleteStickerSet"; 14 | static constexpr http_method_e http_method = http_method_e::POST; 15 | 16 | void fill_nonfile_args(auto& body) const { 17 | body.arg("name", name); 18 | } 19 | }; 20 | 21 | } // namespace tgbm::api 22 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/deleteStory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct delete_story_request { 8 | /* Unique identifier of the business connection */ 9 | String business_connection_id; 10 | /* Unique identifier of the story to delete */ 11 | Integer story_id; 12 | 13 | using return_type = bool; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "deleteStory"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | body.arg("business_connection_id", business_connection_id); 20 | body.arg("story_id", story_id); 21 | } 22 | }; 23 | 24 | } // namespace tgbm::api 25 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/deleteWebhook.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct delete_webhook_request { 8 | /* Pass True to drop all pending updates */ 9 | optional drop_pending_updates; 10 | 11 | using return_type = bool; 12 | static constexpr file_info_e file_info = file_info_e::no; 13 | static constexpr std::string_view api_method_name = "deleteWebhook"; 14 | static constexpr http_method_e http_method = http_method_e::POST; 15 | 16 | void fill_nonfile_args(auto& body) const { 17 | if (drop_pending_updates) 18 | body.arg("drop_pending_updates", *drop_pending_updates); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/editChatSubscriptionInviteLink.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct edit_chat_subscription_invite_link_request { 9 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 10 | */ 11 | int_or_str chat_id; 12 | /* The invite link to edit */ 13 | String invite_link; 14 | /* Invite link name; 0-32 characters */ 15 | optional name; 16 | 17 | using return_type = ChatInviteLink; 18 | static constexpr file_info_e file_info = file_info_e::no; 19 | static constexpr std::string_view api_method_name = "editChatSubscriptionInviteLink"; 20 | static constexpr http_method_e http_method = http_method_e::POST; 21 | 22 | void fill_nonfile_args(auto& body) const { 23 | body.arg("chat_id", chat_id); 24 | body.arg("invite_link", invite_link); 25 | if (name) 26 | body.arg("name", *name); 27 | } 28 | }; 29 | 30 | } // namespace tgbm::api 31 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/editGeneralForumTopic.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct edit_general_forum_topic_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | /* New topic name, 1-128 characters */ 12 | String name; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "editGeneralForumTopic"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("name", name); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/exportChatInviteLink.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct export_chat_invite_link_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | 12 | using return_type = String; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "exportChatInviteLink"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("chat_id", chat_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getAvailableGifts.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_available_gifts_request { 9 | using return_type = Gifts; 10 | static constexpr file_info_e file_info = file_info_e::no; 11 | static constexpr std::string_view api_method_name = "getAvailableGifts"; 12 | static constexpr http_method_e http_method = http_method_e::GET; 13 | }; 14 | 15 | } // namespace tgbm::api 16 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getBusinessAccountStarBalance.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_business_account_star_balance_request { 9 | /* Unique identifier of the business connection */ 10 | String business_connection_id; 11 | 12 | using return_type = StarAmount; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "getBusinessAccountStarBalance"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("business_connection_id", business_connection_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getBusinessConnection.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_business_connection_request { 9 | /* Unique identifier of the business connection */ 10 | String business_connection_id; 11 | 12 | using return_type = BusinessConnection; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "getBusinessConnection"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("business_connection_id", business_connection_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getChat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_chat_request { 9 | /* Unique identifier for the target chat or username of the target supergroup or channel (in the format 10 | * @channelusername) */ 11 | int_or_str chat_id; 12 | 13 | using return_type = ChatFullInfo; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "getChat"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | body.arg("chat_id", chat_id); 20 | } 21 | }; 22 | 23 | } // namespace tgbm::api 24 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getChatAdministrators.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_chat_administrators_request { 9 | /* Unique identifier for the target chat or username of the target supergroup or channel (in the format 10 | * @channelusername) */ 11 | int_or_str chat_id; 12 | 13 | using return_type = arrayof; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "getChatAdministrators"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | body.arg("chat_id", chat_id); 20 | } 21 | }; 22 | 23 | } // namespace tgbm::api 24 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getChatMember.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_chat_member_request { 9 | /* Unique identifier for the target chat or username of the target supergroup or channel (in the format 10 | * @channelusername) */ 11 | int_or_str chat_id; 12 | /* Unique identifier of the target user */ 13 | Integer user_id; 14 | 15 | using return_type = ChatMember; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "getChatMember"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | body.arg("chat_id", chat_id); 22 | body.arg("user_id", user_id); 23 | } 24 | }; 25 | 26 | } // namespace tgbm::api 27 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getChatMemberCount.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct get_chat_member_count_request { 8 | /* Unique identifier for the target chat or username of the target supergroup or channel (in the format 9 | * @channelusername) */ 10 | int_or_str chat_id; 11 | 12 | using return_type = Integer; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "getChatMemberCount"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("chat_id", chat_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getChatMenuButton.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_chat_menu_button_request { 9 | /* Unique identifier for the target private chat. If not specified, default bot's menu button will be 10 | * returned */ 11 | optional chat_id; 12 | 13 | using return_type = MenuButton; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "getChatMenuButton"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | if (chat_id) 20 | body.arg("chat_id", *chat_id); 21 | } 22 | }; 23 | 24 | } // namespace tgbm::api 25 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getCustomEmojiStickers.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_custom_emoji_stickers_request { 9 | /* A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be 10 | * specified. */ 11 | arrayof custom_emoji_ids; 12 | 13 | using return_type = arrayof; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "getCustomEmojiStickers"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | body.arg("custom_emoji_ids", custom_emoji_ids); 20 | } 21 | }; 22 | 23 | } // namespace tgbm::api 24 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getFile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_file_request { 9 | /* File identifier to get information about */ 10 | String file_id; 11 | 12 | using return_type = File; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "getFile"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("file_id", file_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getForumTopicIconStickers.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_forum_topic_icon_stickers_request { 9 | using return_type = arrayof; 10 | static constexpr file_info_e file_info = file_info_e::no; 11 | static constexpr std::string_view api_method_name = "getForumTopicIconStickers"; 12 | static constexpr http_method_e http_method = http_method_e::GET; 13 | }; 14 | 15 | } // namespace tgbm::api 16 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getMe.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_me_request { 9 | using return_type = User; 10 | static constexpr file_info_e file_info = file_info_e::no; 11 | static constexpr std::string_view api_method_name = "getMe"; 12 | static constexpr http_method_e http_method = http_method_e::GET; 13 | }; 14 | 15 | } // namespace tgbm::api 16 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getMyCommands.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace tgbm::api { 8 | 9 | struct get_my_commands_request { 10 | /* A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault. */ 11 | box scope; 12 | /* A two-letter ISO 639-1 language code or an empty string */ 13 | optional language_code; 14 | 15 | using return_type = arrayof; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "getMyCommands"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | if (scope) 22 | body.arg("scope", *scope); 23 | if (language_code) 24 | body.arg("language_code", *language_code); 25 | } 26 | }; 27 | 28 | } // namespace tgbm::api 29 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getMyDefaultAdministratorRights.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_my_default_administrator_rights_request { 9 | /* Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator 10 | * rights of the bot for groups and supergroups will be returned. */ 11 | optional for_channels; 12 | 13 | using return_type = ChatAdministratorRights; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "getMyDefaultAdministratorRights"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | if (for_channels) 20 | body.arg("for_channels", *for_channels); 21 | } 22 | }; 23 | 24 | } // namespace tgbm::api 25 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getMyDescription.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_my_description_request { 9 | /* A two-letter ISO 639-1 language code or an empty string */ 10 | optional language_code; 11 | 12 | using return_type = BotDescription; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "getMyDescription"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | if (language_code) 19 | body.arg("language_code", *language_code); 20 | } 21 | }; 22 | 23 | } // namespace tgbm::api 24 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getMyName.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_my_name_request { 9 | /* A two-letter ISO 639-1 language code or an empty string */ 10 | optional language_code; 11 | 12 | using return_type = BotName; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "getMyName"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | if (language_code) 19 | body.arg("language_code", *language_code); 20 | } 21 | }; 22 | 23 | } // namespace tgbm::api 24 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getMyShortDescription.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_my_short_description_request { 9 | /* A two-letter ISO 639-1 language code or an empty string */ 10 | optional language_code; 11 | 12 | using return_type = BotShortDescription; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "getMyShortDescription"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | if (language_code) 19 | body.arg("language_code", *language_code); 20 | } 21 | }; 22 | 23 | } // namespace tgbm::api 24 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getStarTransactions.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_star_transactions_request { 9 | /* Number of transactions to skip in the response */ 10 | optional offset; 11 | /* The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100. 12 | */ 13 | optional limit; 14 | 15 | using return_type = StarTransactions; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "getStarTransactions"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | if (offset) 22 | body.arg("offset", *offset); 23 | if (limit) 24 | body.arg("limit", *limit); 25 | } 26 | }; 27 | 28 | } // namespace tgbm::api 29 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getStickerSet.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_sticker_set_request { 9 | /* Name of the sticker set */ 10 | String name; 11 | 12 | using return_type = StickerSet; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "getStickerSet"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("name", name); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getUserChatBoosts.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_user_chat_boosts_request { 9 | /* Unique identifier for the chat or username of the channel (in the format @channelusername) */ 10 | int_or_str chat_id; 11 | /* Unique identifier of the target user */ 12 | Integer user_id; 13 | 14 | using return_type = UserChatBoosts; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "getUserChatBoosts"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("user_id", user_id); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getUserProfilePhotos.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_user_profile_photos_request { 9 | /* Unique identifier of the target user */ 10 | Integer user_id; 11 | /* Sequential number of the first photo to be returned. By default, all photos are returned. */ 12 | optional offset; 13 | /* Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. */ 14 | optional limit; 15 | 16 | using return_type = UserProfilePhotos; 17 | static constexpr file_info_e file_info = file_info_e::no; 18 | static constexpr std::string_view api_method_name = "getUserProfilePhotos"; 19 | static constexpr http_method_e http_method = http_method_e::POST; 20 | 21 | void fill_nonfile_args(auto& body) const { 22 | body.arg("user_id", user_id); 23 | if (offset) 24 | body.arg("offset", *offset); 25 | if (limit) 26 | body.arg("limit", *limit); 27 | } 28 | }; 29 | 30 | } // namespace tgbm::api 31 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/getWebhookInfo.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct get_webhook_info_request { 9 | using return_type = WebhookInfo; 10 | static constexpr file_info_e file_info = file_info_e::no; 11 | static constexpr std::string_view api_method_name = "getWebhookInfo"; 12 | static constexpr http_method_e http_method = http_method_e::GET; 13 | }; 14 | 15 | } // namespace tgbm::api 16 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/hideGeneralForumTopic.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct hide_general_forum_topic_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | 12 | using return_type = bool; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "hideGeneralForumTopic"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("chat_id", chat_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/leaveChat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct leave_chat_request { 8 | /* Unique identifier for the target chat or username of the target supergroup or channel (in the format 9 | * @channelusername) */ 10 | int_or_str chat_id; 11 | 12 | using return_type = bool; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "leaveChat"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("chat_id", chat_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/logOut.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct log_out_request { 8 | using return_type = bool; 9 | static constexpr file_info_e file_info = file_info_e::no; 10 | static constexpr std::string_view api_method_name = "logOut"; 11 | static constexpr http_method_e http_method = http_method_e::GET; 12 | }; 13 | 14 | } // namespace tgbm::api 15 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/readBusinessMessage.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct read_business_message_request { 8 | /* Unique identifier of the business connection on behalf of which to read the message */ 9 | String business_connection_id; 10 | /* Unique identifier of the chat in which the message was received. The chat must have been active in the 11 | * last 24 hours. */ 12 | Integer chat_id; 13 | /* Unique identifier of the message to mark as read */ 14 | Integer message_id; 15 | 16 | using return_type = bool; 17 | static constexpr file_info_e file_info = file_info_e::no; 18 | static constexpr std::string_view api_method_name = "readBusinessMessage"; 19 | static constexpr http_method_e http_method = http_method_e::POST; 20 | 21 | void fill_nonfile_args(auto& body) const { 22 | body.arg("business_connection_id", business_connection_id); 23 | body.arg("chat_id", chat_id); 24 | body.arg("message_id", message_id); 25 | } 26 | }; 27 | 28 | } // namespace tgbm::api 29 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/refundStarPayment.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct refund_star_payment_request { 8 | /* Identifier of the user whose payment will be refunded */ 9 | Integer user_id; 10 | /* Telegram payment identifier */ 11 | String telegram_payment_charge_id; 12 | 13 | using return_type = bool; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "refundStarPayment"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | body.arg("user_id", user_id); 20 | body.arg("telegram_payment_charge_id", telegram_payment_charge_id); 21 | } 22 | }; 23 | 24 | } // namespace tgbm::api 25 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/removeBusinessAccountProfilePhoto.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct remove_business_account_profile_photo_request { 8 | /* Unique identifier of the business connection */ 9 | String business_connection_id; 10 | /* Pass True to remove the public photo, which is visible even if the main photo is hidden by the business 11 | * account's privacy settings. After the main photo is removed, the previous profile photo (if present) 12 | * becomes the main photo. */ 13 | optional is_public; 14 | 15 | using return_type = bool; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "removeBusinessAccountProfilePhoto"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | body.arg("business_connection_id", business_connection_id); 22 | if (is_public) 23 | body.arg("is_public", *is_public); 24 | } 25 | }; 26 | 27 | } // namespace tgbm::api 28 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/removeChatVerification.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct remove_chat_verification_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | 12 | using return_type = bool; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "removeChatVerification"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("chat_id", chat_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/removeUserVerification.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct remove_user_verification_request { 8 | /* Unique identifier of the target user */ 9 | Integer user_id; 10 | 11 | using return_type = bool; 12 | static constexpr file_info_e file_info = file_info_e::no; 13 | static constexpr std::string_view api_method_name = "removeUserVerification"; 14 | static constexpr http_method_e http_method = http_method_e::POST; 15 | 16 | void fill_nonfile_args(auto& body) const { 17 | body.arg("user_id", user_id); 18 | } 19 | }; 20 | 21 | } // namespace tgbm::api 22 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/reopenForumTopic.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct reopen_forum_topic_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | /* Unique identifier for the target message thread of the forum topic */ 12 | Integer message_thread_id; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "reopenForumTopic"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("message_thread_id", message_thread_id); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/reopenGeneralForumTopic.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct reopen_general_forum_topic_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | 12 | using return_type = bool; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "reopenGeneralForumTopic"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("chat_id", chat_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/revokeChatInviteLink.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct revoke_chat_invite_link_request { 9 | /* Unique identifier of the target chat or username of the target channel (in the format @channelusername) 10 | */ 11 | int_or_str chat_id; 12 | /* The invite link to revoke */ 13 | String invite_link; 14 | 15 | using return_type = ChatInviteLink; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "revokeChatInviteLink"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | body.arg("chat_id", chat_id); 22 | body.arg("invite_link", invite_link); 23 | } 24 | }; 25 | 26 | } // namespace tgbm::api 27 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setBusinessAccountBio.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_business_account_bio_request { 8 | /* Unique identifier of the business connection */ 9 | String business_connection_id; 10 | /* The new value of the bio for the business account; 0-140 characters */ 11 | optional bio; 12 | 13 | using return_type = bool; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "setBusinessAccountBio"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | body.arg("business_connection_id", business_connection_id); 20 | if (bio) 21 | body.arg("bio", *bio); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setBusinessAccountName.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_business_account_name_request { 8 | /* Unique identifier of the business connection */ 9 | String business_connection_id; 10 | /* The new value of the first name for the business account; 1-64 characters */ 11 | String first_name; 12 | /* The new value of the last name for the business account; 0-64 characters */ 13 | optional last_name; 14 | 15 | using return_type = bool; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "setBusinessAccountName"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | body.arg("business_connection_id", business_connection_id); 22 | body.arg("first_name", first_name); 23 | if (last_name) 24 | body.arg("last_name", *last_name); 25 | } 26 | }; 27 | 28 | } // namespace tgbm::api 29 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setBusinessAccountUsername.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_business_account_username_request { 8 | /* Unique identifier of the business connection */ 9 | String business_connection_id; 10 | /* The new value of the username for the business account; 0-32 characters */ 11 | optional username; 12 | 13 | using return_type = bool; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "setBusinessAccountUsername"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | body.arg("business_connection_id", business_connection_id); 20 | if (username) 21 | body.arg("username", *username); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setChatAdministratorCustomTitle.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_chat_administrator_custom_title_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | /* Unique identifier of the target user */ 12 | Integer user_id; 13 | /* New custom title for the administrator; 0-16 characters, emoji are not allowed */ 14 | String custom_title; 15 | 16 | using return_type = bool; 17 | static constexpr file_info_e file_info = file_info_e::no; 18 | static constexpr std::string_view api_method_name = "setChatAdministratorCustomTitle"; 19 | static constexpr http_method_e http_method = http_method_e::POST; 20 | 21 | void fill_nonfile_args(auto& body) const { 22 | body.arg("chat_id", chat_id); 23 | body.arg("user_id", user_id); 24 | body.arg("custom_title", custom_title); 25 | } 26 | }; 27 | 28 | } // namespace tgbm::api 29 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setChatDescription.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_chat_description_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | /* New chat description, 0-255 characters */ 12 | optional description; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "setChatDescription"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | if (description) 22 | body.arg("description", *description); 23 | } 24 | }; 25 | 26 | } // namespace tgbm::api 27 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setChatMenuButton.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct set_chat_menu_button_request { 9 | /* Unique identifier for the target private chat. If not specified, default bot's menu button will be 10 | * changed */ 11 | optional chat_id; 12 | /* A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault */ 13 | box menu_button; 14 | 15 | using return_type = bool; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "setChatMenuButton"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | if (chat_id) 22 | body.arg("chat_id", *chat_id); 23 | if (menu_button) 24 | body.arg("menu_button", *menu_button); 25 | } 26 | }; 27 | 28 | } // namespace tgbm::api 29 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setChatPhoto.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_chat_photo_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | /* New chat photo, uploaded using multipart/form-data */ 12 | InputFile photo; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::yes; 16 | static constexpr std::string_view api_method_name = "setChatPhoto"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | } 22 | 23 | [[nodiscard]] bool has_file_args() const noexcept { 24 | return true; 25 | } 26 | 27 | void fill_file_args(application_multipart_form_data& body) const { 28 | body.arg("photo", photo); 29 | } 30 | }; 31 | 32 | } // namespace tgbm::api 33 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setChatStickerSet.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_chat_sticker_set_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | /* Name of the sticker set to be set as the group sticker set */ 12 | String sticker_set_name; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "setChatStickerSet"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("sticker_set_name", sticker_set_name); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setChatTitle.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_chat_title_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | /* New chat title, 1-128 characters */ 12 | String title; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "setChatTitle"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("title", title); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setCustomEmojiStickerSetThumbnail.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_custom_emoji_sticker_set_thumbnail_request { 8 | /* Sticker set name */ 9 | String name; 10 | /* Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and 11 | * use the first sticker as the thumbnail. */ 12 | optional custom_emoji_id; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "setCustomEmojiStickerSetThumbnail"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("name", name); 21 | if (custom_emoji_id) 22 | body.arg("custom_emoji_id", *custom_emoji_id); 23 | } 24 | }; 25 | 26 | } // namespace tgbm::api 27 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setMyDescription.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_my_description_request { 8 | /* New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the 9 | * given language. */ 10 | optional description; 11 | /* A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose 12 | * language there is no dedicated description. */ 13 | optional language_code; 14 | 15 | using return_type = bool; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "setMyDescription"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | if (description) 22 | body.arg("description", *description); 23 | if (language_code) 24 | body.arg("language_code", *language_code); 25 | } 26 | }; 27 | 28 | } // namespace tgbm::api 29 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setMyName.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_my_name_request { 8 | /* New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. 9 | */ 10 | optional name; 11 | /* A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language 12 | * there is no dedicated name. */ 13 | optional language_code; 14 | 15 | using return_type = bool; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "setMyName"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | if (name) 22 | body.arg("name", *name); 23 | if (language_code) 24 | body.arg("language_code", *language_code); 25 | } 26 | }; 27 | 28 | } // namespace tgbm::api 29 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setPassportDataErrors.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct set_passport_data_errors_request { 9 | /* User identifier */ 10 | Integer user_id; 11 | /* A JSON-serialized array describing the errors */ 12 | arrayof errors; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "setPassportDataErrors"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("user_id", user_id); 21 | body.arg("errors", errors); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setStickerEmojiList.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_sticker_emoji_list_request { 8 | /* File identifier of the sticker */ 9 | String sticker; 10 | /* A JSON-serialized list of 1-20 emoji associated with the sticker */ 11 | arrayof emoji_list; 12 | 13 | using return_type = bool; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "setStickerEmojiList"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | body.arg("sticker", sticker); 20 | body.arg("emoji_list", emoji_list); 21 | } 22 | }; 23 | 24 | } // namespace tgbm::api 25 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setStickerKeywords.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_sticker_keywords_request { 8 | /* File identifier of the sticker */ 9 | String sticker; 10 | /* A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters 11 | */ 12 | optional> keywords; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "setStickerKeywords"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("sticker", sticker); 21 | if (keywords) 22 | body.arg("keywords", *keywords); 23 | } 24 | }; 25 | 26 | } // namespace tgbm::api 27 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setStickerMaskPosition.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace tgbm::api { 7 | 8 | struct set_sticker_mask_position_request { 9 | /* File identifier of the sticker */ 10 | String sticker; 11 | /* A JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter 12 | * to remove the mask position. */ 13 | box mask_position; 14 | 15 | using return_type = bool; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "setStickerMaskPosition"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | body.arg("sticker", sticker); 22 | if (mask_position) 23 | body.arg("mask_position", *mask_position); 24 | } 25 | }; 26 | 27 | } // namespace tgbm::api 28 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setStickerPositionInSet.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_sticker_position_in_set_request { 8 | /* File identifier of the sticker */ 9 | String sticker; 10 | /* New sticker position in the set, zero-based */ 11 | Integer position; 12 | 13 | using return_type = bool; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "setStickerPositionInSet"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | body.arg("sticker", sticker); 20 | body.arg("position", position); 21 | } 22 | }; 23 | 24 | } // namespace tgbm::api 25 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/setStickerSetTitle.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct set_sticker_set_title_request { 8 | /* Sticker set name */ 9 | String name; 10 | /* Sticker set title, 1-64 characters */ 11 | String title; 12 | 13 | using return_type = bool; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "setStickerSetTitle"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | body.arg("name", name); 20 | body.arg("title", title); 21 | } 22 | }; 23 | 24 | } // namespace tgbm::api 25 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/transferBusinessAccountStars.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct transfer_business_account_stars_request { 8 | /* Unique identifier of the business connection */ 9 | String business_connection_id; 10 | /* Number of Telegram Stars to transfer; 1-10000 */ 11 | Integer star_count; 12 | 13 | using return_type = bool; 14 | static constexpr file_info_e file_info = file_info_e::no; 15 | static constexpr std::string_view api_method_name = "transferBusinessAccountStars"; 16 | static constexpr http_method_e http_method = http_method_e::POST; 17 | 18 | void fill_nonfile_args(auto& body) const { 19 | body.arg("business_connection_id", business_connection_id); 20 | body.arg("star_count", star_count); 21 | } 22 | }; 23 | 24 | } // namespace tgbm::api 25 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/unbanChatMember.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct unban_chat_member_request { 8 | /* Unique identifier for the target group or username of the target supergroup or channel (in the format 9 | * @channelusername) */ 10 | int_or_str chat_id; 11 | /* Unique identifier of the target user */ 12 | Integer user_id; 13 | /* Do nothing if the user is not banned */ 14 | optional only_if_banned; 15 | 16 | using return_type = bool; 17 | static constexpr file_info_e file_info = file_info_e::no; 18 | static constexpr std::string_view api_method_name = "unbanChatMember"; 19 | static constexpr http_method_e http_method = http_method_e::POST; 20 | 21 | void fill_nonfile_args(auto& body) const { 22 | body.arg("chat_id", chat_id); 23 | body.arg("user_id", user_id); 24 | if (only_if_banned) 25 | body.arg("only_if_banned", *only_if_banned); 26 | } 27 | }; 28 | 29 | } // namespace tgbm::api 30 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/unbanChatSenderChat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct unban_chat_sender_chat_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | /* Unique identifier of the target sender chat */ 12 | Integer sender_chat_id; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "unbanChatSenderChat"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("sender_chat_id", sender_chat_id); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/unhideGeneralForumTopic.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct unhide_general_forum_topic_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | 12 | using return_type = bool; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "unhideGeneralForumTopic"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("chat_id", chat_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/unpinAllChatMessages.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct unpin_all_chat_messages_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | 12 | using return_type = bool; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "unpinAllChatMessages"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("chat_id", chat_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/unpinAllForumTopicMessages.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct unpin_all_forum_topic_messages_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | /* Unique identifier for the target message thread of the forum topic */ 12 | Integer message_thread_id; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "unpinAllForumTopicMessages"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("chat_id", chat_id); 21 | body.arg("message_thread_id", message_thread_id); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/unpinAllGeneralForumTopicMessages.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct unpin_all_general_forum_topic_messages_request { 8 | /* Unique identifier for the target chat or username of the target supergroup (in the format 9 | * @supergroupusername) */ 10 | int_or_str chat_id; 11 | 12 | using return_type = bool; 13 | static constexpr file_info_e file_info = file_info_e::no; 14 | static constexpr std::string_view api_method_name = "unpinAllGeneralForumTopicMessages"; 15 | static constexpr http_method_e http_method = http_method_e::POST; 16 | 17 | void fill_nonfile_args(auto& body) const { 18 | body.arg("chat_id", chat_id); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/verifyChat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct verify_chat_request { 8 | /* Unique identifier for the target chat or username of the target channel (in the format @channelusername) 9 | */ 10 | int_or_str chat_id; 11 | /* Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed 12 | * to provide a custom verification description. */ 13 | optional custom_description; 14 | 15 | using return_type = bool; 16 | static constexpr file_info_e file_info = file_info_e::no; 17 | static constexpr std::string_view api_method_name = "verifyChat"; 18 | static constexpr http_method_e http_method = http_method_e::POST; 19 | 20 | void fill_nonfile_args(auto& body) const { 21 | body.arg("chat_id", chat_id); 22 | if (custom_description) 23 | body.arg("custom_description", *custom_description); 24 | } 25 | }; 26 | 27 | } // namespace tgbm::api 28 | -------------------------------------------------------------------------------- /include/tgbm/api/methods/verifyUser.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct verify_user_request { 8 | /* Unique identifier of the target user */ 9 | Integer user_id; 10 | /* Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed 11 | * to provide a custom verification description. */ 12 | optional custom_description; 13 | 14 | using return_type = bool; 15 | static constexpr file_info_e file_info = file_info_e::no; 16 | static constexpr std::string_view api_method_name = "verifyUser"; 17 | static constexpr http_method_e http_method = http_method_e::POST; 18 | 19 | void fill_nonfile_args(auto& body) const { 20 | body.arg("user_id", user_id); 21 | if (custom_description) 22 | body.arg("custom_description", *custom_description); 23 | } 24 | }; 25 | 26 | } // namespace tgbm::api 27 | -------------------------------------------------------------------------------- /include/tgbm/api/oneof.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | template 8 | using oneof = box_union; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /include/tgbm/api/reply_markup.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct InlineKeyboardMarkup; 8 | struct ReplyKeyboardMarkup; 9 | struct ReplyKeyboardRemove; 10 | struct ForceReply; 11 | 12 | using reply_markup_t = box_union; 13 | 14 | } // namespace tgbm::api 15 | -------------------------------------------------------------------------------- /include/tgbm/api/true.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | struct True { 8 | constexpr std::strong_ordering operator<=>(const True&) const = default; 9 | }; 10 | 11 | } // namespace tgbm::api 12 | -------------------------------------------------------------------------------- /include/tgbm/api/types/AcceptedGiftTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the types of gifts that can be gifted to a user or a chat.*/ 8 | struct AcceptedGiftTypes { 9 | /* True, if unlimited regular gifts are accepted */ 10 | bool unlimited_gifts; 11 | /* True, if limited regular gifts are accepted */ 12 | bool limited_gifts; 13 | /* True, if unique gifts or gifts that can be upgraded to unique for free are accepted */ 14 | bool unique_gifts; 15 | /* True, if a Telegram Premium subscription is accepted */ 16 | bool premium_subscription; 17 | 18 | consteval static bool is_mandatory_field(std::string_view name) { 19 | return string_switch(name) 20 | .case_("unlimited_gifts", true) 21 | .case_("limited_gifts", true) 22 | .case_("unique_gifts", true) 23 | .case_("premium_subscription", true) 24 | .or_default(false); 25 | } 26 | }; 27 | 28 | } // namespace tgbm::api 29 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BackgroundFillFreeformGradient.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the way a background is filled based on the selected colors. Currently, it can be one 8 | * of*/ 9 | struct BackgroundFillFreeformGradient { 10 | /* A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format */ 11 | arrayof colors; 12 | 13 | consteval static bool is_mandatory_field(std::string_view name) { 14 | return string_switch(name).case_("colors", true).or_default(false); 15 | } 16 | }; 17 | 18 | } // namespace tgbm::api 19 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BackgroundFillGradient.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the way a background is filled based on the selected colors. Currently, it can be one 8 | * of*/ 9 | struct BackgroundFillGradient { 10 | /* Top color of the gradient in the RGB24 format */ 11 | Integer top_color; 12 | /* Bottom color of the gradient in the RGB24 format */ 13 | Integer bottom_color; 14 | /* Clockwise rotation angle of the background fill in degrees; 0-359 */ 15 | Integer rotation_angle; 16 | 17 | consteval static bool is_mandatory_field(std::string_view name) { 18 | return string_switch(name) 19 | .case_("top_color", true) 20 | .case_("bottom_color", true) 21 | .case_("rotation_angle", true) 22 | .or_default(false); 23 | } 24 | }; 25 | 26 | } // namespace tgbm::api 27 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BackgroundFillSolid.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the way a background is filled based on the selected colors. Currently, it can be one 8 | * of*/ 9 | struct BackgroundFillSolid { 10 | /* The color of the background fill in the RGB24 format */ 11 | Integer color; 12 | 13 | consteval static bool is_mandatory_field(std::string_view name) { 14 | return string_switch(name).case_("color", true).or_default(false); 15 | } 16 | }; 17 | 18 | } // namespace tgbm::api 19 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BackgroundTypeChatTheme.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the type of a background. Currently, it can be one of*/ 8 | struct BackgroundTypeChatTheme { 9 | /* Name of the chat theme, which is usually an emoji */ 10 | String theme_name; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("theme_name", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BackgroundTypeFill.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the type of a background. Currently, it can be one of*/ 8 | struct BackgroundTypeFill { 9 | /* The background fill */ 10 | box fill; 11 | /* Dimming of the background in dark themes, as a percentage; 0-100 */ 12 | Integer dark_theme_dimming; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("fill", true).case_("dark_theme_dimming", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BackgroundTypeWallpaper.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the type of a background. Currently, it can be one of*/ 8 | struct BackgroundTypeWallpaper { 9 | /* Document with the wallpaper */ 10 | box document; 11 | /* Dimming of the background in dark themes, as a percentage; 0-100 */ 12 | Integer dark_theme_dimming; 13 | /* Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with 14 | * radius 12 */ 15 | optional is_blurred; 16 | /* Optional. True, if the background moves slightly when the device is tilted */ 17 | optional is_moving; 18 | 19 | consteval static bool is_mandatory_field(std::string_view name) { 20 | return string_switch(name) 21 | .case_("document", true) 22 | .case_("dark_theme_dimming", true) 23 | .or_default(false); 24 | } 25 | }; 26 | 27 | } // namespace tgbm::api 28 | -------------------------------------------------------------------------------- /include/tgbm/api/types/Birthdate.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*Describes the birthdate of a user.*/ 8 | struct Birthdate { 9 | /* Day of the user's birth; 1-31 */ 10 | Integer day; 11 | /* Month of the user's birth; 1-12 */ 12 | Integer month; 13 | /* Optional. Year of the user's birth */ 14 | optional year; 15 | 16 | consteval static bool is_mandatory_field(std::string_view name) { 17 | return string_switch(name).case_("day", true).case_("month", true).or_default(false); 18 | } 19 | }; 20 | 21 | } // namespace tgbm::api 22 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BotCommand.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a bot command.*/ 8 | struct BotCommand { 9 | /* Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. 10 | */ 11 | String command; 12 | /* Description of the command; 1-256 characters. */ 13 | String description; 14 | 15 | consteval static bool is_mandatory_field(std::string_view name) { 16 | return string_switch(name).case_("command", true).case_("description", true).or_default(false); 17 | } 18 | }; 19 | 20 | } // namespace tgbm::api 21 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BotCommandScopeAllChatAdministrators.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are 8 | * supported:*/ 9 | struct BotCommandScopeAllChatAdministrators { 10 | consteval static bool is_mandatory_field(std::string_view name) { 11 | return string_switch(name).or_default(false); 12 | } 13 | }; 14 | 15 | } // namespace tgbm::api 16 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BotCommandScopeAllGroupChats.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are 8 | * supported:*/ 9 | struct BotCommandScopeAllGroupChats { 10 | consteval static bool is_mandatory_field(std::string_view name) { 11 | return string_switch(name).or_default(false); 12 | } 13 | }; 14 | 15 | } // namespace tgbm::api 16 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BotCommandScopeAllPrivateChats.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are 8 | * supported:*/ 9 | struct BotCommandScopeAllPrivateChats { 10 | consteval static bool is_mandatory_field(std::string_view name) { 11 | return string_switch(name).or_default(false); 12 | } 13 | }; 14 | 15 | } // namespace tgbm::api 16 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BotCommandScopeChat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are 8 | * supported:*/ 9 | struct BotCommandScopeChat { 10 | /* Unique identifier for the target chat or username of the target supergroup (in the format 11 | * @supergroupusername) */ 12 | int_or_str chat_id; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("chat_id", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BotCommandScopeChatAdministrators.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are 8 | * supported:*/ 9 | struct BotCommandScopeChatAdministrators { 10 | /* Unique identifier for the target chat or username of the target supergroup (in the format 11 | * @supergroupusername) */ 12 | int_or_str chat_id; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("chat_id", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BotCommandScopeChatMember.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are 8 | * supported:*/ 9 | struct BotCommandScopeChatMember { 10 | /* Unique identifier for the target chat or username of the target supergroup (in the format 11 | * @supergroupusername) */ 12 | int_or_str chat_id; 13 | /* Unique identifier of the target user */ 14 | Integer user_id; 15 | 16 | consteval static bool is_mandatory_field(std::string_view name) { 17 | return string_switch(name).case_("chat_id", true).case_("user_id", true).or_default(false); 18 | } 19 | }; 20 | 21 | } // namespace tgbm::api 22 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BotCommandScopeDefault.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are 8 | * supported:*/ 9 | struct BotCommandScopeDefault { 10 | consteval static bool is_mandatory_field(std::string_view name) { 11 | return string_switch(name).or_default(false); 12 | } 13 | }; 14 | 15 | } // namespace tgbm::api 16 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BotDescription.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents the bot's description.*/ 8 | struct BotDescription { 9 | /* The bot's description */ 10 | String description; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("description", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BotName.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents the bot's name.*/ 8 | struct BotName { 9 | /* The bot's name */ 10 | String name; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("name", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BotShortDescription.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents the bot's short description.*/ 8 | struct BotShortDescription { 9 | /* The bot's short description */ 10 | String short_description; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("short_description", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BusinessIntro.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*Contains information about the start page settings of a Telegram Business account.*/ 8 | struct BusinessIntro { 9 | /* Optional. Title text of the business intro */ 10 | optional title; 11 | /* Optional. Message text of the business intro */ 12 | optional message; 13 | /* Optional. Sticker of the business intro */ 14 | box sticker; 15 | 16 | consteval static bool is_mandatory_field(std::string_view name) { 17 | return string_switch(name).or_default(false); 18 | } 19 | }; 20 | 21 | } // namespace tgbm::api 22 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BusinessLocation.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*Contains information about the location of a Telegram Business account.*/ 8 | struct BusinessLocation { 9 | /* Address of the business */ 10 | String address; 11 | /* Optional. Location of the business */ 12 | box location; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("address", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BusinessMessagesDeleted.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object is received when messages are deleted from a connected business account.*/ 8 | struct BusinessMessagesDeleted { 9 | /* Unique identifier of the business connection */ 10 | String business_connection_id; 11 | /* Information about a chat in the business account. The bot may not have access to the chat or the 12 | * corresponding user. */ 13 | box chat; 14 | /* The list of identifiers of deleted messages in the chat of the business account */ 15 | arrayof message_ids; 16 | 17 | consteval static bool is_mandatory_field(std::string_view name) { 18 | return string_switch(name) 19 | .case_("business_connection_id", true) 20 | .case_("chat", true) 21 | .case_("message_ids", true) 22 | .or_default(false); 23 | } 24 | }; 25 | 26 | } // namespace tgbm::api 27 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BusinessOpeningHours.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*Describes the opening hours of a business.*/ 8 | struct BusinessOpeningHours { 9 | /* Unique name of the time zone for which the opening hours are defined */ 10 | String time_zone_name; 11 | /* List of time intervals describing business opening hours */ 12 | arrayof opening_hours; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name) 16 | .case_("time_zone_name", true) 17 | .case_("opening_hours", true) 18 | .or_default(false); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/types/BusinessOpeningHoursInterval.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*Describes an interval of time during which a business is open.*/ 8 | struct BusinessOpeningHoursInterval { 9 | /* The minute's sequence number in a week, starting on Monday, marking the start of the time interval during 10 | * which the business is open; 0 - 7 * 24 * 60 */ 11 | Integer opening_minute; 12 | /* The minute's sequence number in a week, starting on Monday, marking the end of the time interval during 13 | * which the business is open; 0 - 8 * 24 * 60 */ 14 | Integer closing_minute; 15 | 16 | consteval static bool is_mandatory_field(std::string_view name) { 17 | return string_switch(name) 18 | .case_("opening_minute", true) 19 | .case_("closing_minute", true) 20 | .or_default(false); 21 | } 22 | }; 23 | 24 | } // namespace tgbm::api 25 | -------------------------------------------------------------------------------- /include/tgbm/api/types/CallbackGame.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*A placeholder, currently holds no information. Use BotFather to set up your game.*/ 8 | struct CallbackGame { 9 | /* Yes */ 10 | Integer user_id; 11 | /* Yes */ 12 | Integer score; 13 | /* Optional */ 14 | optional chat_id; 15 | /* Optional */ 16 | optional message_id; 17 | /* Optional */ 18 | optional inline_message_id; 19 | /* Optional */ 20 | optional force; 21 | /* Optional */ 22 | optional disable_edit_message; 23 | 24 | consteval static bool is_mandatory_field(std::string_view name) { 25 | return string_switch(name).case_("user_id", true).case_("score", true).or_default(false); 26 | } 27 | }; 28 | 29 | } // namespace tgbm::api 30 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatBackground.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a chat background.*/ 8 | struct ChatBackground { 9 | /* Type of the background */ 10 | box type; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("type", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatBoost.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object contains information about a chat boost.*/ 8 | struct ChatBoost { 9 | /* Unique identifier of the boost */ 10 | String boost_id; 11 | /* Point in time (Unix timestamp) when the chat was boosted */ 12 | Integer add_date; 13 | /* Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram 14 | * Premium subscription is prolonged */ 15 | Integer expiration_date; 16 | /* Source of the added boost */ 17 | box source; 18 | 19 | consteval static bool is_mandatory_field(std::string_view name) { 20 | return string_switch(name) 21 | .case_("boost_id", true) 22 | .case_("add_date", true) 23 | .case_("expiration_date", true) 24 | .case_("source", true) 25 | .or_default(false); 26 | } 27 | }; 28 | 29 | } // namespace tgbm::api 30 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatBoostAdded.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a service message about a user boosting a chat.*/ 8 | struct ChatBoostAdded { 9 | /* Number of boosts added by the user */ 10 | Integer boost_count; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("boost_count", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatBoostRemoved.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a boost removed from a chat.*/ 8 | struct ChatBoostRemoved { 9 | /* Chat which was boosted */ 10 | box chat; 11 | /* Unique identifier of the boost */ 12 | String boost_id; 13 | /* Point in time (Unix timestamp) when the boost was removed */ 14 | Integer remove_date; 15 | /* Source of the removed boost */ 16 | box source; 17 | 18 | consteval static bool is_mandatory_field(std::string_view name) { 19 | return string_switch(name) 20 | .case_("chat", true) 21 | .case_("boost_id", true) 22 | .case_("remove_date", true) 23 | .case_("source", true) 24 | .or_default(false); 25 | } 26 | }; 27 | 28 | } // namespace tgbm::api 29 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatBoostSourceGiftCode.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the source of a chat boost. It can be one of*/ 8 | struct ChatBoostSourceGiftCode { 9 | /* User for which the gift code was created */ 10 | box user; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("user", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatBoostSourceGiveaway.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the source of a chat boost. It can be one of*/ 8 | struct ChatBoostSourceGiveaway { 9 | /* Identifier of a message in the chat with the giveaway; the message could have been deleted already. May 10 | * be 0 if the message isn't sent yet. */ 11 | Integer giveaway_message_id; 12 | /* Optional. User that won the prize in the giveaway if any; for Telegram Premium giveaways only */ 13 | box user; 14 | /* Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways 15 | * only */ 16 | optional prize_star_count; 17 | /* Optional. True, if the giveaway was completed, but there was no user to win the prize */ 18 | optional is_unclaimed; 19 | 20 | consteval static bool is_mandatory_field(std::string_view name) { 21 | return string_switch(name).case_("giveaway_message_id", true).or_default(false); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatBoostSourcePremium.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the source of a chat boost. It can be one of*/ 8 | struct ChatBoostSourcePremium { 9 | /* User that boosted the chat */ 10 | box user; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("user", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatBoostUpdated.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a boost added to a chat or changed.*/ 8 | struct ChatBoostUpdated { 9 | /* Chat which was boosted */ 10 | box chat; 11 | /* Information about the chat boost */ 12 | box boost; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("chat", true).case_("boost", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatLocation.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*Represents a location to which a chat is connected.*/ 8 | struct ChatLocation { 9 | /* The location to which the supergroup is connected. Can't be a live location. */ 10 | box location; 11 | /* Location address; 1-64 characters, as defined by the chat owner */ 12 | String address; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("location", true).case_("address", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatMemberBanned.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object contains information about one member of a chat. Currently, the following 6 types of chat 8 | * members are supported:*/ 9 | struct ChatMemberBanned { 10 | /* Information about the user */ 11 | box user; 12 | /* Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever */ 13 | Integer until_date; 14 | 15 | consteval static bool is_mandatory_field(std::string_view name) { 16 | return string_switch(name).case_("user", true).case_("until_date", true).or_default(false); 17 | } 18 | }; 19 | 20 | } // namespace tgbm::api 21 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatMemberLeft.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object contains information about one member of a chat. Currently, the following 6 types of chat 8 | * members are supported:*/ 9 | struct ChatMemberLeft { 10 | /* Information about the user */ 11 | box user; 12 | 13 | consteval static bool is_mandatory_field(std::string_view name) { 14 | return string_switch(name).case_("user", true).or_default(false); 15 | } 16 | }; 17 | 18 | } // namespace tgbm::api 19 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatMemberMember.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object contains information about one member of a chat. Currently, the following 6 types of chat 8 | * members are supported:*/ 9 | struct ChatMemberMember { 10 | /* Information about the user */ 11 | box user; 12 | /* Optional. Date when the user's subscription will expire; Unix time */ 13 | optional until_date; 14 | 15 | consteval static bool is_mandatory_field(std::string_view name) { 16 | return string_switch(name).case_("user", true).or_default(false); 17 | } 18 | }; 19 | 20 | } // namespace tgbm::api 21 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ChatMemberOwner.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object contains information about one member of a chat. Currently, the following 6 types of chat 8 | * members are supported:*/ 9 | struct ChatMemberOwner { 10 | /* Information about the user */ 11 | box user; 12 | /* True, if the user's presence in the chat is hidden */ 13 | bool is_anonymous; 14 | /* Optional. Custom title for this user */ 15 | optional custom_title; 16 | 17 | consteval static bool is_mandatory_field(std::string_view name) { 18 | return string_switch(name).case_("user", true).case_("is_anonymous", true).or_default(false); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/types/Contact.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a phone contact.*/ 8 | struct Contact { 9 | /* Contact's phone number */ 10 | String phone_number; 11 | /* Contact's first name */ 12 | String first_name; 13 | /* Optional. Contact's last name */ 14 | optional last_name; 15 | /* Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and 16 | * some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 17 | * significant bits, so a 64-bit integer or double-precision float type are safe for storing this 18 | * identifier. */ 19 | optional user_id; 20 | /* Optional. Additional data about the contact in the form of a vCard */ 21 | optional vcard; 22 | 23 | consteval static bool is_mandatory_field(std::string_view name) { 24 | return string_switch(name).case_("phone_number", true).case_("first_name", true).or_default(false); 25 | } 26 | }; 27 | 28 | } // namespace tgbm::api 29 | -------------------------------------------------------------------------------- /include/tgbm/api/types/CopyTextButton.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents an inline keyboard button that copies specified text to the clipboard.*/ 8 | struct CopyTextButton { 9 | /* The text to be copied to the clipboard; 1-256 characters */ 10 | String text; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("text", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/Dice.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents an animated emoji that displays a random value.*/ 8 | struct Dice { 9 | /* Emoji on which the dice throw animation is based */ 10 | String emoji; 11 | /* Value of the dice, 1-6 for “”, “” and “” base emoji, 1-5 for “” and “” base emoji, 1-64 for “” base emoji 12 | */ 13 | Integer value; 14 | 15 | consteval static bool is_mandatory_field(std::string_view name) { 16 | return string_switch(name).case_("emoji", true).case_("value", true).or_default(false); 17 | } 18 | }; 19 | 20 | } // namespace tgbm::api 21 | -------------------------------------------------------------------------------- /include/tgbm/api/types/EncryptedCredentials.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram 8 | * Passport Documentation for a complete description of the data decryption and authentication processes.*/ 9 | struct EncryptedCredentials { 10 | /* Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets 11 | * required for EncryptedPassportElement decryption and authentication */ 12 | String data; 13 | /* Base64-encoded data hash for data authentication */ 14 | String hash; 15 | /* Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption */ 16 | String secret; 17 | 18 | consteval static bool is_mandatory_field(std::string_view name) { 19 | return string_switch(name) 20 | .case_("data", true) 21 | .case_("hash", true) 22 | .case_("secret", true) 23 | .or_default(false); 24 | } 25 | }; 26 | 27 | } // namespace tgbm::api 28 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ForumTopic.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a forum topic.*/ 8 | struct ForumTopic { 9 | /* Unique identifier of the forum topic */ 10 | Integer message_thread_id; 11 | /* Name of the topic */ 12 | String name; 13 | /* Color of the topic icon in RGB format */ 14 | Integer icon_color; 15 | /* Optional. Unique identifier of the custom emoji shown as the topic icon */ 16 | optional icon_custom_emoji_id; 17 | 18 | consteval static bool is_mandatory_field(std::string_view name) { 19 | return string_switch(name) 20 | .case_("message_thread_id", true) 21 | .case_("name", true) 22 | .case_("icon_color", true) 23 | .or_default(false); 24 | } 25 | }; 26 | 27 | } // namespace tgbm::api 28 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ForumTopicClosed.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a service message about a forum topic closed in the chat. Currently holds no 8 | * information.*/ 9 | struct ForumTopicClosed { 10 | /* Optional. New name of the topic, if it was edited */ 11 | optional name; 12 | /* Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string 13 | * if the icon was removed */ 14 | optional icon_custom_emoji_id; 15 | 16 | consteval static bool is_mandatory_field(std::string_view name) { 17 | return string_switch(name).or_default(false); 18 | } 19 | }; 20 | 21 | } // namespace tgbm::api 22 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ForumTopicCreated.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a service message about a new forum topic created in the chat.*/ 8 | struct ForumTopicCreated { 9 | /* Name of the topic */ 10 | String name; 11 | /* Color of the topic icon in RGB format */ 12 | Integer icon_color; 13 | /* Optional. Unique identifier of the custom emoji shown as the topic icon */ 14 | optional icon_custom_emoji_id; 15 | 16 | consteval static bool is_mandatory_field(std::string_view name) { 17 | return string_switch(name).case_("name", true).case_("icon_color", true).or_default(false); 18 | } 19 | }; 20 | 21 | } // namespace tgbm::api 22 | -------------------------------------------------------------------------------- /include/tgbm/api/types/ForumTopicEdited.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a service message about an edited forum topic.*/ 8 | struct ForumTopicEdited { 9 | /* Optional. New name of the topic, if it was edited */ 10 | optional name; 11 | /* Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string 12 | * if the icon was removed */ 13 | optional icon_custom_emoji_id; 14 | 15 | consteval static bool is_mandatory_field(std::string_view name) { 16 | return string_switch(name).or_default(false); 17 | } 18 | }; 19 | 20 | } // namespace tgbm::api 21 | -------------------------------------------------------------------------------- /include/tgbm/api/types/GameHighScore.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents one row of the high scores table for a game.*/ 8 | struct GameHighScore { 9 | /* Position in high score table for the game */ 10 | Integer position; 11 | /* User */ 12 | box user; 13 | /* Score */ 14 | Integer score; 15 | 16 | consteval static bool is_mandatory_field(std::string_view name) { 17 | return string_switch(name) 18 | .case_("position", true) 19 | .case_("user", true) 20 | .case_("score", true) 21 | .or_default(false); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/types/Gifts.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represent a list of gifts.*/ 8 | struct Gifts { 9 | /* The list of gifts */ 10 | arrayof gifts; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("gifts", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/GiveawayCompleted.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a service message about the completion of a giveaway without public winners.*/ 8 | struct GiveawayCompleted { 9 | /* Number of winners in the giveaway */ 10 | Integer winner_count; 11 | /* Optional. Number of undistributed prizes */ 12 | optional unclaimed_prize_count; 13 | /* Optional. Message with the giveaway that was completed, if it wasn't deleted */ 14 | box giveaway_message; 15 | /* Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a 16 | * Telegram Premium giveaway. */ 17 | optional is_star_giveaway; 18 | 19 | consteval static bool is_mandatory_field(std::string_view name) { 20 | return string_switch(name).case_("winner_count", true).or_default(false); 21 | } 22 | }; 23 | 24 | } // namespace tgbm::api 25 | -------------------------------------------------------------------------------- /include/tgbm/api/types/GiveawayCreated.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a service message about the creation of a scheduled giveaway.*/ 8 | struct GiveawayCreated { 9 | /* Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways 10 | * only */ 11 | optional prize_star_count; 12 | 13 | consteval static bool is_mandatory_field(std::string_view name) { 14 | return string_switch(name).or_default(false); 15 | } 16 | }; 17 | 18 | } // namespace tgbm::api 19 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InaccessibleMessage.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes a message that was deleted or is otherwise inaccessible to the bot.*/ 8 | struct InaccessibleMessage { 9 | /* Chat the message belonged to */ 10 | box chat; 11 | /* Unique message identifier inside the chat */ 12 | Integer message_id; 13 | /* Always 0. The field can be used to differentiate regular and inaccessible messages. */ 14 | Integer date; 15 | 16 | consteval static bool is_mandatory_field(std::string_view name) { 17 | return string_switch(name) 18 | .case_("chat", true) 19 | .case_("message_id", true) 20 | .case_("date", true) 21 | .or_default(false); 22 | } 23 | }; 24 | 25 | } // namespace tgbm::api 26 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InlineKeyboardMarkup.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents an inline keyboard that appears right next to the message it belongs to.*/ 8 | struct InlineKeyboardMarkup { 9 | /* Array of button rows, each represented by an Array of InlineKeyboardButton objects */ 10 | arrayof> inline_keyboard; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("inline_keyboard", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InlineQueryResultCachedSticker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents one result of an inline query. Telegram clients currently support results of the 8 | * following 20 types:*/ 9 | struct InlineQueryResultCachedSticker { 10 | /* Unique identifier for this result, 1-64 bytes */ 11 | String id; 12 | /* A valid file identifier of the sticker */ 13 | String sticker_file_id; 14 | /* Optional. Inline keyboard attached to the message */ 15 | box reply_markup; 16 | /* Optional. Content of the message to be sent instead of the sticker */ 17 | box input_message_content; 18 | 19 | consteval static bool is_mandatory_field(std::string_view name) { 20 | return string_switch(name).case_("id", true).case_("sticker_file_id", true).or_default(false); 21 | } 22 | }; 23 | 24 | } // namespace tgbm::api 25 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InlineQueryResultGame.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents one result of an inline query. Telegram clients currently support results of the 8 | * following 20 types:*/ 9 | struct InlineQueryResultGame { 10 | /* Unique identifier for this result, 1-64 bytes */ 11 | String id; 12 | /* Short name of the game */ 13 | String game_short_name; 14 | /* Optional. Inline keyboard attached to the message */ 15 | box reply_markup; 16 | 17 | consteval static bool is_mandatory_field(std::string_view name) { 18 | return string_switch(name).case_("id", true).case_("game_short_name", true).or_default(false); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InputContactMessageContent.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents the content of a message to be sent as a result of an inline query. Telegram clients 8 | * currently support the following 5 types:*/ 9 | struct InputContactMessageContent { 10 | /* Contact's first name */ 11 | String first_name; 12 | /* Optional. Contact's last name */ 13 | optional last_name; 14 | /* Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes */ 15 | optional vcard; 16 | 17 | consteval static bool is_mandatory_field(std::string_view name) { 18 | return string_switch(name).case_("first_name", true).or_default(false); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InputFile.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InputMessageContent.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace tgbm::api { 11 | 12 | /*This object represents the content of a message to be sent as a result of an inline query. Telegram clients 13 | * currently support the following 5 types:*/ 14 | using InputMessageContent = 15 | oneof; 17 | 18 | } // namespace tgbm::api 19 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InputPaidMediaPhoto.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the paid media to be sent. Currently, it can be one of*/ 8 | struct InputPaidMediaPhoto { 9 | /* File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an 10 | * HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a 11 | * new one using multipart/form-data under name. More information on Sending Files » */ 12 | String media; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("media", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InputPollOption.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object contains information about one answer option in a poll to be sent.*/ 8 | struct InputPollOption { 9 | /* Option text, 1-100 characters */ 10 | String text; 11 | /* Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only 12 | * custom emoji entities are allowed */ 13 | optional text_parse_mode; 14 | /* Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be 15 | * specified instead of text_parse_mode */ 16 | optional> text_entities; 17 | 18 | consteval static bool is_mandatory_field(std::string_view name) { 19 | return string_switch(name).case_("text", true).or_default(false); 20 | } 21 | }; 22 | 23 | } // namespace tgbm::api 24 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InputProfilePhotoAnimated.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes a profile photo to set. Currently, it can be one of*/ 8 | struct InputProfilePhotoAnimated { 9 | /* The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you 10 | * can pass “attach://” if the photo was uploaded using multipart/form-data under 11 | * . More information on Sending Files » */ 12 | String animation; 13 | /* Optional. Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 14 | * 0.0. */ 15 | optional main_frame_timestamp; 16 | 17 | consteval static bool is_mandatory_field(std::string_view name) { 18 | return string_switch(name).case_("animation", true).or_default(false); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InputProfilePhotoStatic.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes a profile photo to set. Currently, it can be one of*/ 8 | struct InputProfilePhotoStatic { 9 | /* The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you 10 | * can pass “attach://” if the photo was uploaded using multipart/form-data under 11 | * . More information on Sending Files » */ 12 | String photo; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("photo", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InputStoryContentPhoto.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the content of a story to post. Currently, it can be one of*/ 8 | struct InputStoryContentPhoto { 9 | /* The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The 10 | * photo can't be reused and can only be uploaded as a new file, so you can pass 11 | * “attach://” if the photo was uploaded using multipart/form-data under 12 | * . More information on Sending Files » */ 13 | String photo; 14 | 15 | consteval static bool is_mandatory_field(std::string_view name) { 16 | return string_switch(name).case_("photo", true).or_default(false); 17 | } 18 | }; 19 | 20 | } // namespace tgbm::api 21 | -------------------------------------------------------------------------------- /include/tgbm/api/types/InputTextMessageContent.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents the content of a message to be sent as a result of an inline query. Telegram clients 8 | * currently support the following 5 types:*/ 9 | struct InputTextMessageContent { 10 | /* Optional. Mode for parsing entities in the message text. See formatting options for more details. */ 11 | optional parse_mode; 12 | /* Optional. List of special entities that appear in message text, which can be specified instead of 13 | * parse_mode */ 14 | optional> entities; 15 | /* Optional. Link preview generation options for the message */ 16 | box link_preview_options; 17 | 18 | consteval static bool is_mandatory_field(std::string_view name) { 19 | return string_switch(name).or_default(false); 20 | } 21 | }; 22 | 23 | } // namespace tgbm::api 24 | -------------------------------------------------------------------------------- /include/tgbm/api/types/KeyboardButtonPollType.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents type of a poll, which is allowed to be created and sent when the corresponding button 8 | * is pressed.*/ 9 | struct KeyboardButtonPollType { 10 | /* Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular 11 | * is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of 12 | * any type. */ 13 | optional type; 14 | 15 | consteval static bool is_mandatory_field(std::string_view name) { 16 | return string_switch(name).or_default(false); 17 | } 18 | }; 19 | 20 | } // namespace tgbm::api 21 | -------------------------------------------------------------------------------- /include/tgbm/api/types/LabeledPrice.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a portion of the price for goods or services.*/ 8 | struct LabeledPrice { 9 | /* Portion label */ 10 | String label; 11 | /* Price of the product in the smallest units of the currency (integer, not float/double). For example, for 12 | * a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of 13 | * digits past the decimal point for each currency (2 for the majority of currencies). */ 14 | Integer amount; 15 | 16 | consteval static bool is_mandatory_field(std::string_view name) { 17 | return string_switch(name).case_("label", true).case_("amount", true).or_default(false); 18 | } 19 | }; 20 | 21 | } // namespace tgbm::api 22 | -------------------------------------------------------------------------------- /include/tgbm/api/types/LocationAddress.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*Describes the physical address of a location.*/ 8 | struct LocationAddress { 9 | /* The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located */ 10 | String country_code; 11 | /* Optional. State of the location */ 12 | optional state; 13 | /* Optional. City of the location */ 14 | optional city; 15 | /* Optional. Street address of the location */ 16 | optional street; 17 | 18 | consteval static bool is_mandatory_field(std::string_view name) { 19 | return string_switch(name).case_("country_code", true).or_default(false); 20 | } 21 | }; 22 | 23 | } // namespace tgbm::api 24 | -------------------------------------------------------------------------------- /include/tgbm/api/types/MaybeInaccessibleMessage.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | using MaybeInaccessibleMessage = Message; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /include/tgbm/api/types/MenuButtonCommands.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the bot's menu button in a private chat. It should be one of*/ 8 | struct MenuButtonCommands { 9 | consteval static bool is_mandatory_field(std::string_view name) { 10 | return string_switch(name).or_default(false); 11 | } 12 | }; 13 | 14 | } // namespace tgbm::api 15 | -------------------------------------------------------------------------------- /include/tgbm/api/types/MenuButtonDefault.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the bot's menu button in a private chat. It should be one of*/ 8 | struct MenuButtonDefault { 9 | consteval static bool is_mandatory_field(std::string_view name) { 10 | return string_switch(name).or_default(false); 11 | } 12 | }; 13 | 14 | } // namespace tgbm::api 15 | -------------------------------------------------------------------------------- /include/tgbm/api/types/MenuButtonWebApp.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the bot's menu button in a private chat. It should be one of*/ 8 | struct MenuButtonWebApp { 9 | /* Text on the button */ 10 | String text; 11 | /* Description of the Web App that will be launched when the user presses the button. The Web App will be 12 | * able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. 13 | * Alternatively, a t.me link to a Web App of the bot can be specified in the object instead of the Web 14 | * App's URL, in which case the Web App will be opened as if the user pressed the link. */ 15 | box web_app; 16 | 17 | consteval static bool is_mandatory_field(std::string_view name) { 18 | return string_switch(name).case_("text", true).case_("web_app", true).or_default(false); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/types/MessageAutoDeleteTimerChanged.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a service message about a change in auto-delete timer settings.*/ 8 | struct MessageAutoDeleteTimerChanged { 9 | /* New auto-delete time for messages in the chat; in seconds */ 10 | Integer message_auto_delete_time; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("message_auto_delete_time", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/MessageId.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents a unique message identifier.*/ 8 | struct MessageId { 9 | /* Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), 10 | * the server might automatically schedule a message instead of sending it immediately. In such cases, this 11 | * field will be 0 and the relevant message will be unusable until it is actually sent */ 12 | Integer message_id; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("message_id", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/MessageOriginChannel.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the origin of a message. It can be one of*/ 8 | struct MessageOriginChannel { 9 | /* Date the message was sent originally in Unix time */ 10 | Integer date; 11 | /* Channel chat to which the message was originally sent */ 12 | box chat; 13 | /* Unique message identifier inside the chat */ 14 | Integer message_id; 15 | /* Optional. Signature of the original post author */ 16 | optional author_signature; 17 | 18 | consteval static bool is_mandatory_field(std::string_view name) { 19 | return string_switch(name) 20 | .case_("date", true) 21 | .case_("chat", true) 22 | .case_("message_id", true) 23 | .or_default(false); 24 | } 25 | }; 26 | 27 | } // namespace tgbm::api 28 | -------------------------------------------------------------------------------- /include/tgbm/api/types/MessageOriginChat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the origin of a message. It can be one of*/ 8 | struct MessageOriginChat { 9 | /* Date the message was sent originally in Unix time */ 10 | Integer date; 11 | /* Chat that sent the message originally */ 12 | box sender_chat; 13 | /* Optional. For messages originally sent by an anonymous chat administrator, original message author 14 | * signature */ 15 | optional author_signature; 16 | 17 | consteval static bool is_mandatory_field(std::string_view name) { 18 | return string_switch(name).case_("date", true).case_("sender_chat", true).or_default(false); 19 | } 20 | }; 21 | 22 | } // namespace tgbm::api 23 | -------------------------------------------------------------------------------- /include/tgbm/api/types/MessageOriginHiddenUser.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the origin of a message. It can be one of*/ 8 | struct MessageOriginHiddenUser { 9 | /* Date the message was sent originally in Unix time */ 10 | Integer date; 11 | /* Name of the user that sent the message originally */ 12 | String sender_user_name; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("date", true).case_("sender_user_name", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/MessageOriginUser.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes the origin of a message. It can be one of*/ 8 | struct MessageOriginUser { 9 | /* Date the message was sent originally in Unix time */ 10 | Integer date; 11 | /* User that sent the message originally */ 12 | box sender_user; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("date", true).case_("sender_user", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/MessageReactionCountUpdated.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents reaction changes on a message with anonymous reactions.*/ 8 | struct MessageReactionCountUpdated { 9 | /* The chat containing the message */ 10 | box chat; 11 | /* Unique message identifier inside the chat */ 12 | Integer message_id; 13 | /* Date of the change in Unix time */ 14 | Integer date; 15 | /* List of reactions that are present on the message */ 16 | arrayof reactions; 17 | 18 | consteval static bool is_mandatory_field(std::string_view name) { 19 | return string_switch(name) 20 | .case_("chat", true) 21 | .case_("message_id", true) 22 | .case_("date", true) 23 | .case_("reactions", true) 24 | .or_default(false); 25 | } 26 | }; 27 | 28 | } // namespace tgbm::api 29 | -------------------------------------------------------------------------------- /include/tgbm/api/types/OrderInfo.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object represents information about an order.*/ 8 | struct OrderInfo { 9 | /* Optional. User name */ 10 | optional name; 11 | /* Optional. User's phone number */ 12 | optional phone_number; 13 | /* Optional. User email */ 14 | optional email; 15 | /* Optional. User shipping address */ 16 | box shipping_address; 17 | 18 | consteval static bool is_mandatory_field(std::string_view name) { 19 | return string_switch(name).or_default(false); 20 | } 21 | }; 22 | 23 | } // namespace tgbm::api 24 | -------------------------------------------------------------------------------- /include/tgbm/api/types/OwnedGifts.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*Contains the list of gifts received and owned by a user or a chat.*/ 8 | struct OwnedGifts { 9 | /* The total number of gifts owned by the user or the chat */ 10 | Integer total_count; 11 | /* The list of gifts */ 12 | arrayof gifts; 13 | /* Optional. Offset for the next request. If empty, then there are no more results */ 14 | optional next_offset; 15 | 16 | consteval static bool is_mandatory_field(std::string_view name) { 17 | return string_switch(name).case_("total_count", true).case_("gifts", true).or_default(false); 18 | } 19 | }; 20 | 21 | } // namespace tgbm::api 22 | -------------------------------------------------------------------------------- /include/tgbm/api/types/PaidMediaInfo.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*Describes the paid media added to a message.*/ 8 | struct PaidMediaInfo { 9 | /* The number of Telegram Stars that must be paid to buy access to the media */ 10 | Integer star_count; 11 | /* Information about the paid media */ 12 | arrayof paid_media; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("star_count", true).case_("paid_media", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/PaidMediaPhoto.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes paid media. Currently, it can be one of*/ 8 | struct PaidMediaPhoto { 9 | /* The photo */ 10 | arrayof photo; 11 | 12 | consteval static bool is_mandatory_field(std::string_view name) { 13 | return string_switch(name).case_("photo", true).or_default(false); 14 | } 15 | }; 16 | 17 | } // namespace tgbm::api 18 | -------------------------------------------------------------------------------- /include/tgbm/api/types/PaidMediaPreview.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes paid media. Currently, it can be one of*/ 8 | struct PaidMediaPreview { 9 | /* Optional. Media width as defined by the sender */ 10 | optional width; 11 | /* Optional. Media height as defined by the sender */ 12 | optional height; 13 | /* Optional. Duration of the media in seconds as defined by the sender */ 14 | optional duration; 15 | 16 | consteval static bool is_mandatory_field(std::string_view name) { 17 | return string_switch(name).or_default(false); 18 | } 19 | }; 20 | 21 | } // namespace tgbm::api 22 | -------------------------------------------------------------------------------- /include/tgbm/api/types/PaidMediaPurchased.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object contains information about a paid media purchase.*/ 8 | struct PaidMediaPurchased { 9 | /* User who purchased the media */ 10 | box from; 11 | /* Bot-specified paid media payload */ 12 | String paid_media_payload; 13 | 14 | consteval static bool is_mandatory_field(std::string_view name) { 15 | return string_switch(name).case_("from", true).case_("paid_media_payload", true).or_default(false); 16 | } 17 | }; 18 | 19 | } // namespace tgbm::api 20 | -------------------------------------------------------------------------------- /include/tgbm/api/types/PaidMediaVideo.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace tgbm::api { 6 | 7 | /*This object describes paid media. Currently, it can be one of*/ 8 | struct PaidMediaVideo { 9 | /* The video */ 10 | box