@effect-ak/tg-bot-api 0.9.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
package/dist/index.d.ts CHANGED
@@ -395,6 +395,7 @@ interface AcceptedGiftTypes {
395
395
  limited_gifts: boolean;
396
396
  unique_gifts: boolean;
397
397
  premium_subscription: boolean;
398
+ gifts_from_channels: boolean;
398
399
  }
399
400
  interface AffiliateInfo {
400
401
  commission_per_mille: number;
@@ -679,6 +680,9 @@ interface ChatFullInfo {
679
680
  custom_emoji_sticker_set_name?: string;
680
681
  linked_chat_id?: number;
681
682
  location?: ChatLocation;
683
+ rating?: UserRating;
684
+ unique_gift_colors?: UniqueGiftColors;
685
+ paid_message_star_count?: number;
682
686
  }
683
687
  interface ChatInviteLink {
684
688
  invite_link: string;
@@ -819,6 +823,7 @@ interface ChecklistTask {
819
823
  text: string;
820
824
  text_entities?: MessageEntity[];
821
825
  completed_by_user?: User;
826
+ completed_by_chat?: Chat;
822
827
  completion_date?: number;
823
828
  }
824
829
  interface ChecklistTasksAdded {
@@ -927,12 +932,14 @@ interface ForumTopic {
927
932
  name: string;
928
933
  icon_color: number;
929
934
  icon_custom_emoji_id?: string;
935
+ is_name_implicit?: boolean;
930
936
  }
931
937
  type ForumTopicClosed = never;
932
938
  interface ForumTopicCreated {
933
939
  name: string;
934
940
  icon_color: number;
935
941
  icon_custom_emoji_id?: string;
942
+ is_name_implicit?: boolean;
936
943
  }
937
944
  interface ForumTopicEdited {
938
945
  name?: string;
@@ -959,19 +966,32 @@ interface Gift {
959
966
  sticker: Sticker;
960
967
  star_count: number;
961
968
  upgrade_star_count?: number;
969
+ is_premium?: boolean;
970
+ has_colors?: boolean;
962
971
  total_count?: number;
963
972
  remaining_count?: number;
973
+ personal_total_count?: number;
974
+ personal_remaining_count?: number;
975
+ background?: GiftBackground;
976
+ unique_gift_variant_count?: number;
964
977
  publisher_chat?: Chat;
965
978
  }
979
+ interface GiftBackground {
980
+ center_color: number;
981
+ edge_color: number;
982
+ text_color: number;
983
+ }
966
984
  interface GiftInfo {
967
985
  gift: Gift;
968
986
  owned_gift_id?: string;
969
987
  convert_star_count?: number;
970
988
  prepaid_upgrade_star_count?: number;
989
+ is_upgrade_separate?: boolean;
971
990
  can_be_upgraded?: boolean;
972
991
  text?: string;
973
992
  entities?: MessageEntity[];
974
993
  is_private?: boolean;
994
+ unique_gift_number?: number;
975
995
  }
976
996
  interface Gifts {
977
997
  gifts: Gift[];
@@ -1651,6 +1671,7 @@ interface Message {
1651
1671
  chat_shared?: ChatShared;
1652
1672
  gift?: GiftInfo;
1653
1673
  unique_gift?: UniqueGiftInfo;
1674
+ gift_upgrade_sent?: GiftInfo;
1654
1675
  connected_website?: string;
1655
1676
  write_access_allowed?: WriteAccessAllowed;
1656
1677
  passport_data?: PassportData;
@@ -1758,6 +1779,8 @@ interface OwnedGiftRegular {
1758
1779
  was_refunded?: boolean;
1759
1780
  convert_star_count?: number;
1760
1781
  prepaid_upgrade_star_count?: number;
1782
+ is_upgrade_separate?: boolean;
1783
+ unique_gift_number?: number;
1761
1784
  }
1762
1785
  interface OwnedGifts {
1763
1786
  total_count: number;
@@ -2190,12 +2213,16 @@ interface TransactionPartnerUser {
2190
2213
  premium_subscription_duration?: number;
2191
2214
  }
2192
2215
  interface UniqueGift {
2216
+ gift_id: string;
2193
2217
  base_name: string;
2194
2218
  name: string;
2195
2219
  number: number;
2196
2220
  model: UniqueGiftModel;
2197
2221
  symbol: UniqueGiftSymbol;
2198
2222
  backdrop: UniqueGiftBackdrop;
2223
+ is_premium?: boolean;
2224
+ is_from_blockchain?: boolean;
2225
+ colors?: UniqueGiftColors;
2199
2226
  publisher_chat?: Chat;
2200
2227
  }
2201
2228
  interface UniqueGiftBackdrop {
@@ -2209,10 +2236,19 @@ interface UniqueGiftBackdropColors {
2209
2236
  symbol_color: number;
2210
2237
  text_color: number;
2211
2238
  }
2239
+ interface UniqueGiftColors {
2240
+ model_custom_emoji_id: string;
2241
+ symbol_custom_emoji_id: string;
2242
+ light_theme_main_color: number;
2243
+ light_theme_other_colors: number[];
2244
+ dark_theme_main_color: number;
2245
+ dark_theme_other_colors: number[];
2246
+ }
2212
2247
  interface UniqueGiftInfo {
2213
2248
  gift: UniqueGift;
2214
2249
  origin: string;
2215
- last_resale_star_count?: number;
2250
+ last_resale_currency?: "XTR" | "TON";
2251
+ last_resale_amount?: number;
2216
2252
  owned_gift_id?: string;
2217
2253
  transfer_star_count?: number;
2218
2254
  next_transfer_date?: number;
@@ -2267,6 +2303,7 @@ interface User {
2267
2303
  supports_inline_queries?: boolean;
2268
2304
  can_connect_to_business?: boolean;
2269
2305
  has_main_web_app?: boolean;
2306
+ has_topics_enabled?: boolean;
2270
2307
  }
2271
2308
  interface UserChatBoosts {
2272
2309
  boosts: ChatBoost[];
@@ -2275,6 +2312,12 @@ interface UserProfilePhotos {
2275
2312
  total_count: number;
2276
2313
  photos: PhotoSize[][];
2277
2314
  }
2315
+ interface UserRating {
2316
+ level: number;
2317
+ rating: number;
2318
+ current_level_rating: number;
2319
+ next_level_rating?: number;
2320
+ }
2278
2321
  interface UsersShared {
2279
2322
  request_id: number;
2280
2323
  users: SharedUser[];
@@ -2406,6 +2449,7 @@ interface Api {
2406
2449
  get_business_connection(_: GetBusinessConnectionInput): BusinessConnection;
2407
2450
  get_chat(_: GetChatInput): ChatFullInfo;
2408
2451
  get_chat_administrators(_: GetChatAdministratorsInput): ChatMember[];
2452
+ get_chat_gifts(_: GetChatGiftsInput): OwnedGifts;
2409
2453
  get_chat_member(_: GetChatMemberInput): ChatMember;
2410
2454
  get_chat_member_count(_: GetChatMemberCountInput): number;
2411
2455
  get_chat_menu_button(_: GetChatMenuButtonInput): MenuButton;
@@ -2424,6 +2468,7 @@ interface Api {
2424
2468
  get_sticker_set(_: GetStickerSetInput): StickerSet;
2425
2469
  get_updates(_: GetUpdatesInput): Update[];
2426
2470
  get_user_chat_boosts(_: GetUserChatBoostsInput): UserChatBoosts;
2471
+ get_user_gifts(_: GetUserGiftsInput): OwnedGifts;
2427
2472
  get_user_profile_photos(_: GetUserProfilePhotosInput): UserProfilePhotos;
2428
2473
  get_webhook_info(_: GetWebhookInfoInput): WebhookInfo;
2429
2474
  gift_premium_subscription(_: GiftPremiumSubscriptionInput): boolean;
@@ -2441,6 +2486,7 @@ interface Api {
2441
2486
  reopen_forum_topic(_: ReopenForumTopicInput): boolean;
2442
2487
  reopen_general_forum_topic(_: ReopenGeneralForumTopicInput): boolean;
2443
2488
  replace_sticker_in_set(_: ReplaceStickerInSetInput): boolean;
2489
+ repost_story(_: RepostStoryInput): Story;
2444
2490
  restrict_chat_member(_: RestrictChatMemberInput): boolean;
2445
2491
  revoke_chat_invite_link(_: RevokeChatInviteLinkInput): ChatInviteLink;
2446
2492
  save_prepared_inline_message(_: SavePreparedInlineMessageInput): PreparedInlineMessage;
@@ -2457,6 +2503,7 @@ interface Api {
2457
2503
  send_location(_: SendLocationInput): Message;
2458
2504
  send_media_group(_: SendMediaGroupInput): Message[];
2459
2505
  send_message(_: SendMessageInput): Message;
2506
+ send_message_draft(_: SendMessageDraftInput): boolean;
2460
2507
  send_paid_media(_: SendPaidMediaInput): Message;
2461
2508
  send_photo(_: SendPhotoInput): Message;
2462
2509
  send_poll(_: SendPollInput): Message;
@@ -2591,6 +2638,7 @@ interface CopyMessageInput {
2591
2638
  disable_notification?: boolean;
2592
2639
  protect_content?: boolean;
2593
2640
  allow_paid_broadcast?: boolean;
2641
+ message_effect_id?: string;
2594
2642
  suggested_post_parameters?: SuggestedPostParameters;
2595
2643
  reply_parameters?: ReplyParameters;
2596
2644
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
@@ -2810,6 +2858,7 @@ interface ForwardMessageInput {
2810
2858
  video_start_timestamp?: number;
2811
2859
  disable_notification?: boolean;
2812
2860
  protect_content?: boolean;
2861
+ message_effect_id?: string;
2813
2862
  suggested_post_parameters?: SuggestedPostParameters;
2814
2863
  }
2815
2864
  interface ForwardMessagesInput {
@@ -2828,8 +2877,10 @@ interface GetBusinessAccountGiftsInput {
2828
2877
  exclude_unsaved?: boolean;
2829
2878
  exclude_saved?: boolean;
2830
2879
  exclude_unlimited?: boolean;
2831
- exclude_limited?: boolean;
2880
+ exclude_limited_upgradable?: boolean;
2881
+ exclude_limited_non_upgradable?: boolean;
2832
2882
  exclude_unique?: boolean;
2883
+ exclude_from_blockchain?: boolean;
2833
2884
  sort_by_price?: boolean;
2834
2885
  offset?: string;
2835
2886
  limit?: number;
@@ -2846,6 +2897,19 @@ interface GetChatInput {
2846
2897
  interface GetChatAdministratorsInput {
2847
2898
  chat_id: number | string;
2848
2899
  }
2900
+ interface GetChatGiftsInput {
2901
+ chat_id: number | string;
2902
+ exclude_unsaved?: boolean;
2903
+ exclude_saved?: boolean;
2904
+ exclude_unlimited?: boolean;
2905
+ exclude_limited_upgradable?: boolean;
2906
+ exclude_limited_non_upgradable?: boolean;
2907
+ exclude_from_blockchain?: boolean;
2908
+ exclude_unique?: boolean;
2909
+ sort_by_price?: boolean;
2910
+ offset?: string;
2911
+ limit?: number;
2912
+ }
2849
2913
  interface GetChatMemberInput {
2850
2914
  chat_id: number | string;
2851
2915
  user_id: number;
@@ -2907,6 +2971,17 @@ interface GetUserChatBoostsInput {
2907
2971
  chat_id: number | string;
2908
2972
  user_id: number;
2909
2973
  }
2974
+ interface GetUserGiftsInput {
2975
+ user_id: number;
2976
+ exclude_unlimited?: boolean;
2977
+ exclude_limited_upgradable?: boolean;
2978
+ exclude_limited_non_upgradable?: boolean;
2979
+ exclude_from_blockchain?: boolean;
2980
+ exclude_unique?: boolean;
2981
+ sort_by_price?: boolean;
2982
+ offset?: string;
2983
+ limit?: number;
2984
+ }
2910
2985
  interface GetUserProfilePhotosInput {
2911
2986
  user_id: number;
2912
2987
  offset?: number;
@@ -2999,6 +3074,14 @@ interface ReplaceStickerInSetInput {
2999
3074
  old_sticker: string;
3000
3075
  sticker: InputSticker;
3001
3076
  }
3077
+ interface RepostStoryInput {
3078
+ business_connection_id: string;
3079
+ from_chat_id: number;
3080
+ from_story_id: number;
3081
+ active_period: number;
3082
+ post_to_chat_page?: boolean;
3083
+ protect_content?: boolean;
3084
+ }
3002
3085
  interface RestrictChatMemberInput {
3003
3086
  chat_id: number | string;
3004
3087
  user_id: number;
@@ -3230,6 +3313,14 @@ interface SendMessageInput {
3230
3313
  reply_parameters?: ReplyParameters;
3231
3314
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
3232
3315
  }
3316
+ interface SendMessageDraftInput {
3317
+ chat_id: number;
3318
+ draft_id: number;
3319
+ text: string;
3320
+ message_thread_id?: number;
3321
+ parse_mode?: "HTML" | "MarkdownV2";
3322
+ entities?: MessageEntity[];
3323
+ }
3233
3324
  interface SendPaidMediaInput {
3234
3325
  chat_id: number | string;
3235
3326
  star_count: number;
@@ -3597,4 +3688,4 @@ interface VerifyUserInput {
3597
3688
  custom_description?: string;
3598
3689
  }
3599
3690
 
3600
- export type { Accelerometer, AccelerometerStartParams, AcceptedGiftTypes, AddStickerToSetInput, AffiliateInfo, AllowedUpdateName, Animation, AnswerCallbackQueryInput, AnswerInlineQueryInput, AnswerPreCheckoutQueryInput, AnswerShippingQueryInput, AnswerWebAppQueryInput, Api, ApproveChatJoinRequestInput, ApproveSuggestedPostInput, Audio, BackButton, BackgroundFill, BackgroundFillFreeformGradient, BackgroundFillGradient, BackgroundFillSolid, BackgroundType, BackgroundTypeChatTheme, BackgroundTypeFill, BackgroundTypePattern, BackgroundTypeWallpaper, BanChatMemberInput, BanChatSenderChatInput, BindOrUnbindEventHandler, BiometricAuthenticateParams, BiometricManager, BiometricRequestAccessParams, Birthdate, BotCommand, BotCommandScope, BotCommandScopeAllChatAdministrators, BotCommandScopeAllGroupChats, BotCommandScopeAllPrivateChats, BotCommandScopeChat, BotCommandScopeChatAdministrators, BotCommandScopeChatMember, BotCommandScopeDefault, BotDescription, BotName, BotShortDescription, BottomButton, BusinessBotRights, BusinessConnection, BusinessIntro, BusinessLocation, BusinessMessagesDeleted, BusinessOpeningHours, BusinessOpeningHoursInterval, CallbackGame, CallbackQuery, Chat, ChatAdministratorRights, ChatBackground, ChatBoost, ChatBoostAdded, ChatBoostRemoved, ChatBoostSource, ChatBoostSourceGiftCode, ChatBoostSourceGiveaway, ChatBoostSourcePremium, ChatBoostUpdated, ChatFullInfo, ChatInviteLink, ChatJoinRequest, ChatLocation, ChatMember, ChatMemberAdministrator, ChatMemberBanned, ChatMemberLeft, ChatMemberMember, ChatMemberOwner, ChatMemberRestricted, ChatMemberUpdated, ChatPermissions, ChatPhoto, ChatShared, Checklist, ChecklistTask, ChecklistTasksAdded, ChecklistTasksDone, ChosenInlineResult, CloseForumTopicInput, CloseGeneralForumTopicInput, CloseInput, CloudStorage, Contact, ContentSafeAreaInset, ConvertGiftToStarsInput, CopyMessageInput, CopyMessagesInput, CopyTextButton, CreateChatInviteLinkInput, CreateChatSubscriptionInviteLinkInput, CreateForumTopicInput, CreateInvoiceLinkInput, CreateNewStickerSetInput, DeclineChatJoinRequestInput, DeclineSuggestedPostInput, DeleteBusinessMessagesInput, DeleteChatPhotoInput, DeleteChatStickerSetInput, DeleteForumTopicInput, DeleteMessageInput, DeleteMessagesInput, DeleteMyCommandsInput, DeleteStickerFromSetInput, DeleteStickerSetInput, DeleteStoryInput, DeleteWebhookInput, DeviceOrientation, DeviceOrientationStartParams, DeviceStorage, Dice, DirectMessagePriceChanged, DirectMessagesTopic, Document, DownloadFileParams, EditChatInviteLinkInput, EditChatSubscriptionInviteLinkInput, EditForumTopicInput, EditGeneralForumTopicInput, EditMessageCaptionInput, EditMessageChecklistInput, EditMessageLiveLocationInput, EditMessageMediaInput, EditMessageReplyMarkupInput, EditMessageTextInput, EditStoryInput, EditUserStarSubscriptionInput, EmojiStatusParams, EncryptedCredentials, EncryptedPassportElement, EventHandlers, ExportChatInviteLinkInput, ExternalReplyInfo, File, ForceReply, ForumTopic, ForumTopicClosed, ForumTopicCreated, ForumTopicEdited, ForumTopicReopened, ForwardMessageInput, ForwardMessagesInput, Game, GameHighScore, GeneralForumTopicHidden, GeneralForumTopicUnhidden, GetAvailableGiftsInput, GetBusinessAccountGiftsInput, GetBusinessAccountStarBalanceInput, GetBusinessConnectionInput, GetChatAdministratorsInput, GetChatInput, GetChatMemberCountInput, GetChatMemberInput, GetChatMenuButtonInput, GetCustomEmojiStickersInput, GetFileInput, GetForumTopicIconStickersInput, GetGameHighScoresInput, GetMeInput, GetMyCommandsInput, GetMyDefaultAdministratorRightsInput, GetMyDescriptionInput, GetMyNameInput, GetMyShortDescriptionInput, GetMyStarBalanceInput, GetStarTransactionsInput, GetStickerSetInput, GetUpdatesInput, GetUserChatBoostsInput, GetUserProfilePhotosInput, GetWebhookInfoInput, Gift, GiftInfo, GiftPremiumSubscriptionInput, Gifts, Giveaway, GiveawayCompleted, GiveawayCreated, GiveawayWinners, Gyroscope, GyroscopeStartParams, HapticFeedback, HideGeneralForumTopicInput, InaccessibleMessage, InlineKeyboardButton, InlineKeyboardMarkup, InlineQuery, InlineQueryResult, InlineQueryResultArticle, InlineQueryResultAudio, InlineQueryResultCachedAudio, InlineQueryResultCachedDocument, InlineQueryResultCachedGif, InlineQueryResultCachedMpeg4Gif, InlineQueryResultCachedPhoto, InlineQueryResultCachedSticker, InlineQueryResultCachedVideo, InlineQueryResultCachedVoice, InlineQueryResultContact, InlineQueryResultDocument, InlineQueryResultGame, InlineQueryResultGif, InlineQueryResultLocation, InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQueryResultVenue, InlineQueryResultVideo, InlineQueryResultVoice, InlineQueryResultsButton, InputChecklist, InputChecklistTask, InputContactMessageContent, InputFile, InputInvoiceMessageContent, InputLocationMessageContent, InputMedia, InputMediaAnimation, InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo, InputMessageContent, InputPaidMedia, InputPaidMediaPhoto, InputPaidMediaVideo, InputPollOption, InputProfilePhoto, InputProfilePhotoAnimated, InputProfilePhotoStatic, InputSticker, InputStoryContent, InputStoryContentPhoto, InputStoryContentVideo, InputTextMessageContent, InputVenueMessageContent, Invoice, KeyboardButton, KeyboardButtonPollType, KeyboardButtonRequestChat, KeyboardButtonRequestUsers, LabeledPrice, LeaveChatInput, LinkPreviewOptions, Location, LocationAddress, LocationData, LocationManager, LogOutInput, LoginUrl, MaskPosition, MaybeInaccessibleMessage, MenuButton, MenuButtonCommands, MenuButtonDefault, MenuButtonWebApp, Message, MessageAutoDeleteTimerChanged, MessageEntity, MessageId, MessageOrigin, MessageOriginChannel, MessageOriginChat, MessageOriginHiddenUser, MessageOriginUser, MessageReactionCountUpdated, MessageReactionUpdated, OrderInfo, OwnedGift, OwnedGiftRegular, OwnedGiftUnique, OwnedGifts, PaidMedia, PaidMediaInfo, PaidMediaPhoto, PaidMediaPreview, PaidMediaPurchased, PaidMediaVideo, PaidMessagePriceChanged, PassportData, PassportElementError, PassportElementErrorDataField, PassportElementErrorFile, PassportElementErrorFiles, PassportElementErrorFrontSide, PassportElementErrorReverseSide, PassportElementErrorSelfie, PassportElementErrorTranslationFile, PassportElementErrorTranslationFiles, PassportElementErrorUnspecified, PassportFile, PhotoSize, PinChatMessageInput, Poll, PollAnswer, PollOption, PopupButton, PopupParams, PostStoryInput, PreCheckoutQuery, PreparedInlineMessage, PromoteChatMemberInput, ProximityAlertTriggered, ReactionCount, ReactionType, ReactionTypeCustomEmoji, ReactionTypeEmoji, ReactionTypePaid, ReadBusinessMessageInput, RefundStarPaymentInput, RefundedPayment, RemoveBusinessAccountProfilePhotoInput, RemoveChatVerificationInput, RemoveUserVerificationInput, ReopenForumTopicInput, ReopenGeneralForumTopicInput, ReplaceStickerInSetInput, ReplyKeyboardMarkup, ReplyKeyboardRemove, ReplyParameters, ResponseParameters, RestrictChatMemberInput, RevenueWithdrawalState, RevenueWithdrawalStateFailed, RevenueWithdrawalStatePending, RevenueWithdrawalStateSucceeded, RevokeChatInviteLinkInput, SafeAreaInset, SavePreparedInlineMessageInput, ScanQrPopupParams, SecureStorage, SendAnimationInput, SendAudioInput, SendChatActionInput, SendChecklistInput, SendContactInput, SendDiceInput, SendDocumentInput, SendGameInput, SendGiftInput, SendInvoiceInput, SendLocationInput, SendMediaGroupInput, SendMessageInput, SendPaidMediaInput, SendPhotoInput, SendPollInput, SendStickerInput, SendVenueInput, SendVideoInput, SendVideoNoteInput, SendVoiceInput, SentWebAppMessage, SetBusinessAccountBioInput, SetBusinessAccountGiftSettingsInput, SetBusinessAccountNameInput, SetBusinessAccountProfilePhotoInput, SetBusinessAccountUsernameInput, SetChatAdministratorCustomTitleInput, SetChatDescriptionInput, SetChatMenuButtonInput, SetChatPermissionsInput, SetChatPhotoInput, SetChatStickerSetInput, SetChatTitleInput, SetCustomEmojiStickerSetThumbnailInput, SetGameScoreInput, SetMessageReactionInput, SetMyCommandsInput, SetMyDefaultAdministratorRightsInput, SetMyDescriptionInput, SetMyNameInput, SetMyShortDescriptionInput, SetPassportDataErrorsInput, SetStickerEmojiListInput, SetStickerKeywordsInput, SetStickerMaskPositionInput, SetStickerPositionInSetInput, SetStickerSetThumbnailInput, SetStickerSetTitleInput, SetUserEmojiStatusInput, SetWebhookInput, SettingsButton, SharedUser, ShippingAddress, ShippingOption, ShippingQuery, StarAmount, StarTransaction, StarTransactions, Sticker, StickerSet, StopMessageLiveLocationInput, StopPollInput, Story, StoryArea, StoryAreaPosition, StoryAreaType, StoryAreaTypeLink, StoryAreaTypeLocation, StoryAreaTypeSuggestedReaction, StoryAreaTypeUniqueGift, StoryAreaTypeWeather, StoryShareParams, StoryWidgetLink, SuccessfulPayment, SuggestedPostApprovalFailed, SuggestedPostApproved, SuggestedPostDeclined, SuggestedPostInfo, SuggestedPostPaid, SuggestedPostParameters, SuggestedPostPrice, SuggestedPostRefunded, SwitchInlineQueryChosenChat, TextQuote, ThemeParams, TransactionPartner, TransactionPartnerAffiliateProgram, TransactionPartnerChat, TransactionPartnerFragment, TransactionPartnerOther, TransactionPartnerTelegramAds, TransactionPartnerTelegramApi, TransactionPartnerUser, TransferBusinessAccountStarsInput, TransferGiftInput, UnbanChatMemberInput, UnbanChatSenderChatInput, UnhideGeneralForumTopicInput, UniqueGift, UniqueGiftBackdrop, UniqueGiftBackdropColors, UniqueGiftInfo, UniqueGiftModel, UniqueGiftSymbol, UnpinAllChatMessagesInput, UnpinAllForumTopicMessagesInput, UnpinAllGeneralForumTopicMessagesInput, UnpinChatMessageInput, Update, UpgradeGiftInput, UploadStickerFileInput, User, UserChatBoosts, UserProfilePhotos, UsersShared, Venue, VerifyChatInput, VerifyUserInput, Video, VideoChatEnded, VideoChatParticipantsInvited, VideoChatScheduled, VideoChatStarted, VideoNote, Voice, WebApp, WebAppChat, WebAppData, WebAppInfo, WebAppInitData, WebAppUser, WebhookInfo, WriteAccessAllowed };
3691
+ export type { Accelerometer, AccelerometerStartParams, AcceptedGiftTypes, AddStickerToSetInput, AffiliateInfo, AllowedUpdateName, Animation, AnswerCallbackQueryInput, AnswerInlineQueryInput, AnswerPreCheckoutQueryInput, AnswerShippingQueryInput, AnswerWebAppQueryInput, Api, ApproveChatJoinRequestInput, ApproveSuggestedPostInput, Audio, BackButton, BackgroundFill, BackgroundFillFreeformGradient, BackgroundFillGradient, BackgroundFillSolid, BackgroundType, BackgroundTypeChatTheme, BackgroundTypeFill, BackgroundTypePattern, BackgroundTypeWallpaper, BanChatMemberInput, BanChatSenderChatInput, BindOrUnbindEventHandler, BiometricAuthenticateParams, BiometricManager, BiometricRequestAccessParams, Birthdate, BotCommand, BotCommandScope, BotCommandScopeAllChatAdministrators, BotCommandScopeAllGroupChats, BotCommandScopeAllPrivateChats, BotCommandScopeChat, BotCommandScopeChatAdministrators, BotCommandScopeChatMember, BotCommandScopeDefault, BotDescription, BotName, BotShortDescription, BottomButton, BusinessBotRights, BusinessConnection, BusinessIntro, BusinessLocation, BusinessMessagesDeleted, BusinessOpeningHours, BusinessOpeningHoursInterval, CallbackGame, CallbackQuery, Chat, ChatAdministratorRights, ChatBackground, ChatBoost, ChatBoostAdded, ChatBoostRemoved, ChatBoostSource, ChatBoostSourceGiftCode, ChatBoostSourceGiveaway, ChatBoostSourcePremium, ChatBoostUpdated, ChatFullInfo, ChatInviteLink, ChatJoinRequest, ChatLocation, ChatMember, ChatMemberAdministrator, ChatMemberBanned, ChatMemberLeft, ChatMemberMember, ChatMemberOwner, ChatMemberRestricted, ChatMemberUpdated, ChatPermissions, ChatPhoto, ChatShared, Checklist, ChecklistTask, ChecklistTasksAdded, ChecklistTasksDone, ChosenInlineResult, CloseForumTopicInput, CloseGeneralForumTopicInput, CloseInput, CloudStorage, Contact, ContentSafeAreaInset, ConvertGiftToStarsInput, CopyMessageInput, CopyMessagesInput, CopyTextButton, CreateChatInviteLinkInput, CreateChatSubscriptionInviteLinkInput, CreateForumTopicInput, CreateInvoiceLinkInput, CreateNewStickerSetInput, DeclineChatJoinRequestInput, DeclineSuggestedPostInput, DeleteBusinessMessagesInput, DeleteChatPhotoInput, DeleteChatStickerSetInput, DeleteForumTopicInput, DeleteMessageInput, DeleteMessagesInput, DeleteMyCommandsInput, DeleteStickerFromSetInput, DeleteStickerSetInput, DeleteStoryInput, DeleteWebhookInput, DeviceOrientation, DeviceOrientationStartParams, DeviceStorage, Dice, DirectMessagePriceChanged, DirectMessagesTopic, Document, DownloadFileParams, EditChatInviteLinkInput, EditChatSubscriptionInviteLinkInput, EditForumTopicInput, EditGeneralForumTopicInput, EditMessageCaptionInput, EditMessageChecklistInput, EditMessageLiveLocationInput, EditMessageMediaInput, EditMessageReplyMarkupInput, EditMessageTextInput, EditStoryInput, EditUserStarSubscriptionInput, EmojiStatusParams, EncryptedCredentials, EncryptedPassportElement, EventHandlers, ExportChatInviteLinkInput, ExternalReplyInfo, File, ForceReply, ForumTopic, ForumTopicClosed, ForumTopicCreated, ForumTopicEdited, ForumTopicReopened, ForwardMessageInput, ForwardMessagesInput, Game, GameHighScore, GeneralForumTopicHidden, GeneralForumTopicUnhidden, GetAvailableGiftsInput, GetBusinessAccountGiftsInput, GetBusinessAccountStarBalanceInput, GetBusinessConnectionInput, GetChatAdministratorsInput, GetChatGiftsInput, GetChatInput, GetChatMemberCountInput, GetChatMemberInput, GetChatMenuButtonInput, GetCustomEmojiStickersInput, GetFileInput, GetForumTopicIconStickersInput, GetGameHighScoresInput, GetMeInput, GetMyCommandsInput, GetMyDefaultAdministratorRightsInput, GetMyDescriptionInput, GetMyNameInput, GetMyShortDescriptionInput, GetMyStarBalanceInput, GetStarTransactionsInput, GetStickerSetInput, GetUpdatesInput, GetUserChatBoostsInput, GetUserGiftsInput, GetUserProfilePhotosInput, GetWebhookInfoInput, Gift, GiftBackground, GiftInfo, GiftPremiumSubscriptionInput, Gifts, Giveaway, GiveawayCompleted, GiveawayCreated, GiveawayWinners, Gyroscope, GyroscopeStartParams, HapticFeedback, HideGeneralForumTopicInput, InaccessibleMessage, InlineKeyboardButton, InlineKeyboardMarkup, InlineQuery, InlineQueryResult, InlineQueryResultArticle, InlineQueryResultAudio, InlineQueryResultCachedAudio, InlineQueryResultCachedDocument, InlineQueryResultCachedGif, InlineQueryResultCachedMpeg4Gif, InlineQueryResultCachedPhoto, InlineQueryResultCachedSticker, InlineQueryResultCachedVideo, InlineQueryResultCachedVoice, InlineQueryResultContact, InlineQueryResultDocument, InlineQueryResultGame, InlineQueryResultGif, InlineQueryResultLocation, InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQueryResultVenue, InlineQueryResultVideo, InlineQueryResultVoice, InlineQueryResultsButton, InputChecklist, InputChecklistTask, InputContactMessageContent, InputFile, InputInvoiceMessageContent, InputLocationMessageContent, InputMedia, InputMediaAnimation, InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo, InputMessageContent, InputPaidMedia, InputPaidMediaPhoto, InputPaidMediaVideo, InputPollOption, InputProfilePhoto, InputProfilePhotoAnimated, InputProfilePhotoStatic, InputSticker, InputStoryContent, InputStoryContentPhoto, InputStoryContentVideo, InputTextMessageContent, InputVenueMessageContent, Invoice, KeyboardButton, KeyboardButtonPollType, KeyboardButtonRequestChat, KeyboardButtonRequestUsers, LabeledPrice, LeaveChatInput, LinkPreviewOptions, Location, LocationAddress, LocationData, LocationManager, LogOutInput, LoginUrl, MaskPosition, MaybeInaccessibleMessage, MenuButton, MenuButtonCommands, MenuButtonDefault, MenuButtonWebApp, Message, MessageAutoDeleteTimerChanged, MessageEntity, MessageId, MessageOrigin, MessageOriginChannel, MessageOriginChat, MessageOriginHiddenUser, MessageOriginUser, MessageReactionCountUpdated, MessageReactionUpdated, OrderInfo, OwnedGift, OwnedGiftRegular, OwnedGiftUnique, OwnedGifts, PaidMedia, PaidMediaInfo, PaidMediaPhoto, PaidMediaPreview, PaidMediaPurchased, PaidMediaVideo, PaidMessagePriceChanged, PassportData, PassportElementError, PassportElementErrorDataField, PassportElementErrorFile, PassportElementErrorFiles, PassportElementErrorFrontSide, PassportElementErrorReverseSide, PassportElementErrorSelfie, PassportElementErrorTranslationFile, PassportElementErrorTranslationFiles, PassportElementErrorUnspecified, PassportFile, PhotoSize, PinChatMessageInput, Poll, PollAnswer, PollOption, PopupButton, PopupParams, PostStoryInput, PreCheckoutQuery, PreparedInlineMessage, PromoteChatMemberInput, ProximityAlertTriggered, ReactionCount, ReactionType, ReactionTypeCustomEmoji, ReactionTypeEmoji, ReactionTypePaid, ReadBusinessMessageInput, RefundStarPaymentInput, RefundedPayment, RemoveBusinessAccountProfilePhotoInput, RemoveChatVerificationInput, RemoveUserVerificationInput, ReopenForumTopicInput, ReopenGeneralForumTopicInput, ReplaceStickerInSetInput, ReplyKeyboardMarkup, ReplyKeyboardRemove, ReplyParameters, RepostStoryInput, ResponseParameters, RestrictChatMemberInput, RevenueWithdrawalState, RevenueWithdrawalStateFailed, RevenueWithdrawalStatePending, RevenueWithdrawalStateSucceeded, RevokeChatInviteLinkInput, SafeAreaInset, SavePreparedInlineMessageInput, ScanQrPopupParams, SecureStorage, SendAnimationInput, SendAudioInput, SendChatActionInput, SendChecklistInput, SendContactInput, SendDiceInput, SendDocumentInput, SendGameInput, SendGiftInput, SendInvoiceInput, SendLocationInput, SendMediaGroupInput, SendMessageDraftInput, SendMessageInput, SendPaidMediaInput, SendPhotoInput, SendPollInput, SendStickerInput, SendVenueInput, SendVideoInput, SendVideoNoteInput, SendVoiceInput, SentWebAppMessage, SetBusinessAccountBioInput, SetBusinessAccountGiftSettingsInput, SetBusinessAccountNameInput, SetBusinessAccountProfilePhotoInput, SetBusinessAccountUsernameInput, SetChatAdministratorCustomTitleInput, SetChatDescriptionInput, SetChatMenuButtonInput, SetChatPermissionsInput, SetChatPhotoInput, SetChatStickerSetInput, SetChatTitleInput, SetCustomEmojiStickerSetThumbnailInput, SetGameScoreInput, SetMessageReactionInput, SetMyCommandsInput, SetMyDefaultAdministratorRightsInput, SetMyDescriptionInput, SetMyNameInput, SetMyShortDescriptionInput, SetPassportDataErrorsInput, SetStickerEmojiListInput, SetStickerKeywordsInput, SetStickerMaskPositionInput, SetStickerPositionInSetInput, SetStickerSetThumbnailInput, SetStickerSetTitleInput, SetUserEmojiStatusInput, SetWebhookInput, SettingsButton, SharedUser, ShippingAddress, ShippingOption, ShippingQuery, StarAmount, StarTransaction, StarTransactions, Sticker, StickerSet, StopMessageLiveLocationInput, StopPollInput, Story, StoryArea, StoryAreaPosition, StoryAreaType, StoryAreaTypeLink, StoryAreaTypeLocation, StoryAreaTypeSuggestedReaction, StoryAreaTypeUniqueGift, StoryAreaTypeWeather, StoryShareParams, StoryWidgetLink, SuccessfulPayment, SuggestedPostApprovalFailed, SuggestedPostApproved, SuggestedPostDeclined, SuggestedPostInfo, SuggestedPostPaid, SuggestedPostParameters, SuggestedPostPrice, SuggestedPostRefunded, SwitchInlineQueryChosenChat, TextQuote, ThemeParams, TransactionPartner, TransactionPartnerAffiliateProgram, TransactionPartnerChat, TransactionPartnerFragment, TransactionPartnerOther, TransactionPartnerTelegramAds, TransactionPartnerTelegramApi, TransactionPartnerUser, TransferBusinessAccountStarsInput, TransferGiftInput, UnbanChatMemberInput, UnbanChatSenderChatInput, UnhideGeneralForumTopicInput, UniqueGift, UniqueGiftBackdrop, UniqueGiftBackdropColors, UniqueGiftColors, UniqueGiftInfo, UniqueGiftModel, UniqueGiftSymbol, UnpinAllChatMessagesInput, UnpinAllForumTopicMessagesInput, UnpinAllGeneralForumTopicMessagesInput, UnpinChatMessageInput, Update, UpgradeGiftInput, UploadStickerFileInput, User, UserChatBoosts, UserProfilePhotos, UserRating, UsersShared, Venue, VerifyChatInput, VerifyUserInput, Video, VideoChatEnded, VideoChatParticipantsInvited, VideoChatScheduled, VideoChatStarted, VideoNote, Voice, WebApp, WebAppChat, WebAppData, WebAppInfo, WebAppInitData, WebAppUser, WebhookInfo, WriteAccessAllowed };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-ak/tg-bot-api",
3
- "version": "0.9.2",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "description": "TypeScript types for Telegram Bot Api and Telegram Mini Apps",
6
6
  "license": "MIT",
@@ -39,6 +39,7 @@
39
39
  "dist/*.d.ts"
40
40
  ],
41
41
  "scripts": {
42
- "build": "tsup"
42
+ "build": "tsup",
43
+ "typecheck": "tsc"
43
44
  }
44
45
  }
package/readme.md ADDED
@@ -0,0 +1,37 @@
1
+ ![Telegram Bot API](https://img.shields.io/badge/BotApi-9.2-blue?link=)
2
+ ![Telegram WebApp](https://img.shields.io/badge/Telegram.WebApp-9.1-blue?link=)
3
+ [![OpenAPI](https://img.shields.io/badge/OpenAPI-3.1-blue.svg)](https://effect-ak.github.io/telegram-bot-api/)
4
+
5
+ ## Highlights:
6
+
7
+ - **Complete and Up-to-Date Telegram Bot API**: The entire API is generated from [the official documentation](https://core.telegram.org/bots/api) using a [code generator](./codegen/main.ts), ensuring this client remains in sync and supports every method and type provided by the **Telegram Bot API**.
8
+ - **[Types for Webapps](#webapps-typings)** Types that describe `Telegram.WebApp`. Created by [code generator](./codegen/main.ts) as well.
9
+ - **[ChatBot runner](#chatbot-runner)**: Focus on the logic of your chat bot
10
+ - **Type Mapping**: Types from the documentation are converted to TypeScript types:
11
+ - `Integer` → `number`
12
+ - `True` → `boolean`
13
+ - `String or Number` → `string | number`
14
+ - Enumerated types, such as `"Type of the chat can be either “private”, “group”, “supergroup” or “channel”"`, are converted to a standard union of literal types `"private" | "group" | "supergroup" | "channel"`
15
+ - And more...
16
+
17
+ ## Webapps typings
18
+
19
+ Telegram provides a big [html](https://core.telegram.org/bots/webapps) page that describes `Telegram.WebApp`
20
+
21
+ ```typescript
22
+ import type { WebApp } from "@effect-ak/tg-bot-client/webapp"
23
+
24
+ interface Telegram {
25
+ WebApp: TgWebApp
26
+ }
27
+
28
+ declare const Telegram: Telegram
29
+
30
+ const saveData = () => {
31
+ Telegram.WebApp.CloudStorage.setItem("key1", "some data", (error) => {
32
+ if (error == null) {
33
+ console.log("Saved!")
34
+ }
35
+ })
36
+ }
37
+ ```