// This file is auto-generated by @hey-api/openapi-ts

/**
 * Represents the default response object.
 */
export type Response = {
    ok: boolean;
};

/**
 * Request was successful, the result is returned.
 */
export type Success = Response & {
    result: {
        [key: string]: unknown;
    };
};

/**
 * Request was unsuccessful, so an error occurred.
 */
export type Error = Response & {
    error_code: number;
    description: string;
    parameters?: ResponseParameters;
};

/**
 * This object represents an incoming update.At most one of the optional parameters can be present in any given update.
 */
export type Update = {
    update_id: number;
    message?: Message;
    edited_message?: Message;
    channel_post?: Message;
    edited_channel_post?: Message;
    business_connection?: BusinessConnection;
    business_message?: Message;
    edited_business_message?: Message;
    deleted_business_messages?: BusinessMessagesDeleted;
    message_reaction?: MessageReactionUpdated;
    message_reaction_count?: MessageReactionCountUpdated;
    inline_query?: InlineQuery;
    chosen_inline_result?: ChosenInlineResult;
    callback_query?: CallbackQuery;
    shipping_query?: ShippingQuery;
    pre_checkout_query?: PreCheckoutQuery;
    purchased_paid_media?: PaidMediaPurchased;
    poll?: Poll;
    poll_answer?: PollAnswer;
    my_chat_member?: ChatMemberUpdated;
    chat_member?: ChatMemberUpdated;
    chat_join_request?: ChatJoinRequest;
    chat_boost?: ChatBoostUpdated;
    removed_chat_boost?: ChatBoostRemoved;
};

/**
 * Describes the current status of a webhook.
 */
export type WebhookInfo = {
    url: string;
    has_custom_certificate: boolean;
    pending_update_count: number;
    ip_address?: string;
    last_error_date?: number;
    last_error_message?: string;
    last_synchronization_error_date?: number;
    max_connections?: number;
    allowed_updates?: Array<string>;
};

/**
 * This object represents a Telegram user or bot.
 */
export type User = {
    id: number;
    is_bot: boolean;
    first_name: string;
    last_name?: string;
    username?: string;
    language_code?: string;
    is_premium?: boolean;
    added_to_attachment_menu?: boolean;
    can_join_groups?: boolean;
    can_read_all_group_messages?: boolean;
    supports_inline_queries?: boolean;
    can_connect_to_business?: boolean;
    has_main_web_app?: boolean;
};

/**
 * This object represents a chat.
 */
export type Chat = {
    id: number;
    type: string;
    title?: string;
    username?: string;
    first_name?: string;
    last_name?: string;
    is_forum?: boolean;
};

/**
 * This object contains full information about a chat.
 */
export type ChatFullInfo = {
    id: number;
    type: string;
    title?: string;
    username?: string;
    first_name?: string;
    last_name?: string;
    is_forum?: boolean;
    accent_color_id: number;
    max_reaction_count: number;
    photo?: ChatPhoto;
    active_usernames?: Array<string>;
    birthdate?: Birthdate;
    business_intro?: BusinessIntro;
    business_location?: BusinessLocation;
    business_opening_hours?: BusinessOpeningHours;
    personal_chat?: Chat;
    available_reactions?: Array<ReactionType>;
    background_custom_emoji_id?: string;
    profile_accent_color_id?: number;
    profile_background_custom_emoji_id?: string;
    emoji_status_custom_emoji_id?: string;
    emoji_status_expiration_date?: number;
    bio?: string;
    has_private_forwards?: boolean;
    has_restricted_voice_and_video_messages?: boolean;
    join_to_send_messages?: boolean;
    join_by_request?: boolean;
    description?: string;
    invite_link?: string;
    pinned_message?: Message;
    permissions?: ChatPermissions;
    accepted_gift_types: AcceptedGiftTypes;
    can_send_paid_media?: boolean;
    slow_mode_delay?: number;
    unrestrict_boost_count?: number;
    message_auto_delete_time?: number;
    has_aggressive_anti_spam_enabled?: boolean;
    has_hidden_members?: boolean;
    has_protected_content?: boolean;
    has_visible_history?: boolean;
    sticker_set_name?: string;
    can_set_sticker_set?: boolean;
    custom_emoji_sticker_set_name?: string;
    linked_chat_id?: number;
    location?: ChatLocation;
};

/**
 * This object represents a message.
 */
export type Message = {
    message_id: number;
    message_thread_id?: number;
    from?: User;
    sender_chat?: Chat;
    sender_boost_count?: number;
    sender_business_bot?: User;
    date: number;
    business_connection_id?: string;
    chat: Chat;
    forward_origin?: MessageOrigin;
    is_topic_message?: boolean;
    is_automatic_forward?: boolean;
    reply_to_message?: Message;
    external_reply?: ExternalReplyInfo;
    quote?: TextQuote;
    reply_to_story?: Story;
    via_bot?: User;
    edit_date?: number;
    has_protected_content?: boolean;
    is_from_offline?: boolean;
    media_group_id?: string;
    author_signature?: string;
    paid_star_count?: number;
    text?: string;
    entities?: Array<MessageEntity>;
    link_preview_options?: LinkPreviewOptions;
    effect_id?: string;
    animation?: Animation;
    audio?: Audio;
    document?: Document;
    paid_media?: PaidMediaInfo;
    photo?: Array<PhotoSize>;
    sticker?: Sticker;
    story?: Story;
    video?: Video;
    video_note?: VideoNote;
    voice?: Voice;
    caption?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    has_media_spoiler?: boolean;
    contact?: Contact;
    dice?: Dice;
    game?: Game;
    poll?: Poll;
    venue?: Venue;
    location?: Location;
    new_chat_members?: Array<User>;
    left_chat_member?: User;
    new_chat_title?: string;
    new_chat_photo?: Array<PhotoSize>;
    delete_chat_photo?: boolean;
    group_chat_created?: boolean;
    supergroup_chat_created?: boolean;
    channel_chat_created?: boolean;
    message_auto_delete_timer_changed?: MessageAutoDeleteTimerChanged;
    migrate_to_chat_id?: number;
    migrate_from_chat_id?: number;
    pinned_message?: MaybeInaccessibleMessage;
    invoice?: Invoice;
    successful_payment?: SuccessfulPayment;
    refunded_payment?: RefundedPayment;
    users_shared?: UsersShared;
    chat_shared?: ChatShared;
    gift?: GiftInfo;
    unique_gift?: UniqueGiftInfo;
    connected_website?: string;
    write_access_allowed?: WriteAccessAllowed;
    passport_data?: PassportData;
    proximity_alert_triggered?: ProximityAlertTriggered;
    boost_added?: ChatBoostAdded;
    chat_background_set?: ChatBackground;
    forum_topic_created?: ForumTopicCreated;
    forum_topic_edited?: ForumTopicEdited;
    forum_topic_closed?: ForumTopicClosed;
    forum_topic_reopened?: ForumTopicReopened;
    general_forum_topic_hidden?: GeneralForumTopicHidden;
    general_forum_topic_unhidden?: GeneralForumTopicUnhidden;
    giveaway_created?: GiveawayCreated;
    giveaway?: Giveaway;
    giveaway_winners?: GiveawayWinners;
    giveaway_completed?: GiveawayCompleted;
    paid_message_price_changed?: PaidMessagePriceChanged;
    video_chat_scheduled?: VideoChatScheduled;
    video_chat_started?: VideoChatStarted;
    video_chat_ended?: VideoChatEnded;
    video_chat_participants_invited?: VideoChatParticipantsInvited;
    web_app_data?: WebAppData;
    reply_markup?: InlineKeyboardMarkup;
};

/**
 * This object represents a unique message identifier.
 */
export type MessageId = {
    message_id: number;
};

/**
 * This object describes a message that was deleted or is otherwise inaccessible to the bot.
 */
export type InaccessibleMessage = {
    chat: Chat;
    message_id: number;
    date: number;
};

/**
 * This object describes a message that can be inaccessible to the bot. It can be one of
 */
export type MaybeInaccessibleMessage = Message | InaccessibleMessage;

/**
 * This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
 */
export type MessageEntity = {
    type: string;
    offset: number;
    length: number;
    url?: string;
    user?: User;
    language?: string;
    custom_emoji_id?: string;
};

/**
 * This object contains information about the quoted part of a message that is replied to by the given message.
 */
export type TextQuote = {
    text: string;
    entities?: Array<MessageEntity>;
    position: number;
    is_manual?: boolean;
};

/**
 * This object contains information about a message that is being replied to, which may come from another chat or forum topic.
 */
export type ExternalReplyInfo = {
    origin: MessageOrigin;
    chat?: Chat;
    message_id?: number;
    link_preview_options?: LinkPreviewOptions;
    animation?: Animation;
    audio?: Audio;
    document?: Document;
    paid_media?: PaidMediaInfo;
    photo?: Array<PhotoSize>;
    sticker?: Sticker;
    story?: Story;
    video?: Video;
    video_note?: VideoNote;
    voice?: Voice;
    has_media_spoiler?: boolean;
    contact?: Contact;
    dice?: Dice;
    game?: Game;
    giveaway?: Giveaway;
    giveaway_winners?: GiveawayWinners;
    invoice?: Invoice;
    location?: Location;
    poll?: Poll;
    venue?: Venue;
};

/**
 * Describes reply parameters for the message that is being sent.
 */
export type ReplyParameters = {
    message_id: number;
    chat_id?: number | string;
    allow_sending_without_reply?: boolean;
    quote?: string;
    quote_parse_mode?: string;
    quote_entities?: Array<MessageEntity>;
    quote_position?: number;
};

/**
 * This object describes the origin of a message. It can be one of
 */
export type MessageOrigin = MessageOriginUser | MessageOriginHiddenUser | MessageOriginChat | MessageOriginChannel;

/**
 * The message was originally sent by a known user.
 */
export type MessageOriginUser = {
    type: string;
    date: number;
    sender_user: User;
};

/**
 * The message was originally sent by an unknown user.
 */
export type MessageOriginHiddenUser = {
    type: string;
    date: number;
    sender_user_name: string;
};

/**
 * The message was originally sent on behalf of a chat to a group chat.
 */
export type MessageOriginChat = {
    type: string;
    date: number;
    sender_chat: Chat;
    author_signature?: string;
};

/**
 * The message was originally sent to a channel chat.
 */
export type MessageOriginChannel = {
    type: string;
    date: number;
    chat: Chat;
    message_id: number;
    author_signature?: string;
};

/**
 * This object represents one size of a photo or a file / sticker thumbnail.
 */
export type PhotoSize = {
    file_id: string;
    file_unique_id: string;
    width: number;
    height: number;
    file_size?: number;
};

/**
 * This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
 */
export type Animation = {
    file_id: string;
    file_unique_id: string;
    width: number;
    height: number;
    duration: number;
    thumbnail?: PhotoSize;
    file_name?: string;
    mime_type?: string;
    file_size?: number;
};

/**
 * This object represents an audio file to be treated as music by the Telegram clients.
 */
export type Audio = {
    file_id: string;
    file_unique_id: string;
    duration: number;
    performer?: string;
    title?: string;
    file_name?: string;
    mime_type?: string;
    file_size?: number;
    thumbnail?: PhotoSize;
};

/**
 * This object represents a general file (as opposed to photos, voice messages and audio files).
 */
export type Document = {
    file_id: string;
    file_unique_id: string;
    thumbnail?: PhotoSize;
    file_name?: string;
    mime_type?: string;
    file_size?: number;
};

/**
 * This object represents a story.
 */
export type Story = {
    chat: Chat;
    id: number;
};

/**
 * This object represents a video file.
 */
export type Video = {
    file_id: string;
    file_unique_id: string;
    width: number;
    height: number;
    duration: number;
    thumbnail?: PhotoSize;
    cover?: Array<PhotoSize>;
    start_timestamp?: number;
    file_name?: string;
    mime_type?: string;
    file_size?: number;
};

/**
 * This object represents a video message (available in Telegram apps as of v.4.0).
 */
export type VideoNote = {
    file_id: string;
    file_unique_id: string;
    length: number;
    duration: number;
    thumbnail?: PhotoSize;
    file_size?: number;
};

/**
 * This object represents a voice note.
 */
export type Voice = {
    file_id: string;
    file_unique_id: string;
    duration: number;
    mime_type?: string;
    file_size?: number;
};

/**
 * Describes the paid media added to a message.
 */
export type PaidMediaInfo = {
    star_count: number;
    paid_media: Array<PaidMedia>;
};

/**
 * This object describes paid media. Currently, it can be one of
 */
export type PaidMedia = PaidMediaPreview | PaidMediaPhoto | PaidMediaVideo;

/**
 * The paid media isn't available before the payment.
 */
export type PaidMediaPreview = {
    type: string;
    width?: number;
    height?: number;
    duration?: number;
};

/**
 * The paid media is a photo.
 */
export type PaidMediaPhoto = {
    type: string;
    photo: Array<PhotoSize>;
};

/**
 * The paid media is a video.
 */
export type PaidMediaVideo = {
    type: string;
    video: Video;
};

/**
 * This object represents a phone contact.
 */
export type Contact = {
    phone_number: string;
    first_name: string;
    last_name?: string;
    user_id?: number;
    vcard?: string;
};

/**
 * This object represents an animated emoji that displays a random value.
 */
export type Dice = {
    emoji: string;
    value: number;
};

/**
 * This object contains information about one answer option in a poll.
 */
export type PollOption = {
    text: string;
    text_entities?: Array<MessageEntity>;
    voter_count: number;
};

/**
 * This object contains information about one answer option in a poll to be sent.
 */
export type InputPollOption = {
    text: string;
    text_parse_mode?: string;
    text_entities?: Array<MessageEntity>;
};

/**
 * This object represents an answer of a user in a non-anonymous poll.
 */
export type PollAnswer = {
    poll_id: string;
    voter_chat?: Chat;
    user?: User;
    option_ids: Array<number>;
};

/**
 * This object contains information about a poll.
 */
export type Poll = {
    id: string;
    question: string;
    question_entities?: Array<MessageEntity>;
    options: Array<PollOption>;
    total_voter_count: number;
    is_closed: boolean;
    is_anonymous: boolean;
    type: string;
    allows_multiple_answers: boolean;
    correct_option_id?: number;
    explanation?: string;
    explanation_entities?: Array<MessageEntity>;
    open_period?: number;
    close_date?: number;
};

/**
 * This object represents a point on the map.
 */
export type Location = {
    latitude: number;
    longitude: number;
    horizontal_accuracy?: number;
    live_period?: number;
    heading?: number;
    proximity_alert_radius?: number;
};

/**
 * This object represents a venue.
 */
export type Venue = {
    location: Location;
    title: string;
    address: string;
    foursquare_id?: string;
    foursquare_type?: string;
    google_place_id?: string;
    google_place_type?: string;
};

/**
 * Describes data sent from a Web App to the bot.
 */
export type WebAppData = {
    data: string;
    button_text: string;
};

/**
 * This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
 */
export type ProximityAlertTriggered = {
    traveler: User;
    watcher: User;
    distance: number;
};

/**
 * This object represents a service message about a change in auto-delete timer settings.
 */
export type MessageAutoDeleteTimerChanged = {
    message_auto_delete_time: number;
};

/**
 * This object represents a service message about a user boosting a chat.
 */
export type ChatBoostAdded = {
    boost_count: number;
};

/**
 * This object describes the way a background is filled based on the selected colors. Currently, it can be one of
 */
export type BackgroundFill = BackgroundFillSolid | BackgroundFillGradient | BackgroundFillFreeformGradient;

/**
 * The background is filled using the selected color.
 */
export type BackgroundFillSolid = {
    type: string;
    color: number;
};

/**
 * The background is a gradient fill.
 */
export type BackgroundFillGradient = {
    type: string;
    top_color: number;
    bottom_color: number;
    rotation_angle: number;
};

/**
 * The background is a freeform gradient that rotates after every message in the chat.
 */
export type BackgroundFillFreeformGradient = {
    type: string;
    colors: Array<number>;
};

/**
 * This object describes the type of a background. Currently, it can be one of
 */
export type BackgroundType = BackgroundTypeFill | BackgroundTypeWallpaper | BackgroundTypePattern | BackgroundTypeChatTheme;

/**
 * The background is automatically filled based on the selected colors.
 */
export type BackgroundTypeFill = {
    type: string;
    fill: BackgroundFill;
    dark_theme_dimming: number;
};

/**
 * The background is a wallpaper in the JPEG format.
 */
export type BackgroundTypeWallpaper = {
    type: string;
    document: Document;
    dark_theme_dimming: number;
    is_blurred?: boolean;
    is_moving?: boolean;
};

/**
 * The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.
 */
export type BackgroundTypePattern = {
    type: string;
    document: Document;
    fill: BackgroundFill;
    intensity: number;
    is_inverted?: boolean;
    is_moving?: boolean;
};

/**
 * The background is taken directly from a built-in chat theme.
 */
export type BackgroundTypeChatTheme = {
    type: string;
    theme_name: string;
};

/**
 * This object represents a chat background.
 */
export type ChatBackground = {
    type: BackgroundType;
};

/**
 * This object represents a service message about a new forum topic created in the chat.
 */
export type ForumTopicCreated = {
    name: string;
    icon_color: number;
    icon_custom_emoji_id?: string;
};

/**
 * This object represents a service message about a forum topic closed in the chat. Currently holds no information.
 */
export type ForumTopicClosed = {
    [key: string]: unknown;
};

/**
 * This object represents a service message about an edited forum topic.
 */
export type ForumTopicEdited = {
    name?: string;
    icon_custom_emoji_id?: string;
};

/**
 * This object represents a service message about a forum topic reopened in the chat. Currently holds no information.
 */
export type ForumTopicReopened = {
    [key: string]: unknown;
};

/**
 * This object represents a service message about General forum topic hidden in the chat. Currently holds no information.
 */
export type GeneralForumTopicHidden = {
    [key: string]: unknown;
};

/**
 * This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.
 */
export type GeneralForumTopicUnhidden = {
    [key: string]: unknown;
};

/**
 * This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.
 */
export type SharedUser = {
    user_id: number;
    first_name?: string;
    last_name?: string;
    username?: string;
    photo?: Array<PhotoSize>;
};

/**
 * This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
 */
export type UsersShared = {
    request_id: number;
    users: Array<SharedUser>;
};

/**
 * This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.
 */
export type ChatShared = {
    request_id: number;
    chat_id: number;
    title?: string;
    username?: string;
    photo?: Array<PhotoSize>;
};

/**
 * This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.
 */
export type WriteAccessAllowed = {
    from_request?: boolean;
    web_app_name?: string;
    from_attachment_menu?: boolean;
};

/**
 * This object represents a service message about a video chat scheduled in the chat.
 */
export type VideoChatScheduled = {
    start_date: number;
};

/**
 * This object represents a service message about a video chat started in the chat. Currently holds no information.
 */
export type VideoChatStarted = {
    [key: string]: unknown;
};

/**
 * This object represents a service message about a video chat ended in the chat.
 */
export type VideoChatEnded = {
    duration: number;
};

/**
 * This object represents a service message about new members invited to a video chat.
 */
export type VideoChatParticipantsInvited = {
    users: Array<User>;
};

/**
 * Describes a service message about a change in the price of paid messages within a chat.
 */
export type PaidMessagePriceChanged = {
    paid_message_star_count: number;
};

/**
 * This object represents a service message about the creation of a scheduled giveaway.
 */
export type GiveawayCreated = {
    prize_star_count?: number;
};

/**
 * This object represents a message about a scheduled giveaway.
 */
export type Giveaway = {
    chats: Array<Chat>;
    winners_selection_date: number;
    winner_count: number;
    only_new_members?: boolean;
    has_public_winners?: boolean;
    prize_description?: string;
    country_codes?: Array<string>;
    prize_star_count?: number;
    premium_subscription_month_count?: number;
};

/**
 * This object represents a message about the completion of a giveaway with public winners.
 */
export type GiveawayWinners = {
    chat: Chat;
    giveaway_message_id: number;
    winners_selection_date: number;
    winner_count: number;
    winners: Array<User>;
    additional_chat_count?: number;
    prize_star_count?: number;
    premium_subscription_month_count?: number;
    unclaimed_prize_count?: number;
    only_new_members?: boolean;
    was_refunded?: boolean;
    prize_description?: string;
};

/**
 * This object represents a service message about the completion of a giveaway without public winners.
 */
export type GiveawayCompleted = {
    winner_count: number;
    unclaimed_prize_count?: number;
    giveaway_message?: Message;
    is_star_giveaway?: boolean;
};

/**
 * Describes the options used for link preview generation.
 */
export type LinkPreviewOptions = {
    is_disabled?: boolean;
    url?: string;
    prefer_small_media?: boolean;
    prefer_large_media?: boolean;
    show_above_text?: boolean;
};

/**
 * This object represent a user's profile pictures.
 */
export type UserProfilePhotos = {
    total_count: number;
    photos: Array<Array<PhotoSize>>;
};

/**
 * This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.
 */
export type File = {
    file_id: string;
    file_unique_id: string;
    file_size?: number;
    file_path?: string;
};

/**
 * Describes a Web App.
 */
export type WebAppInfo = {
    url: string;
};

/**
 * This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.
 */
export type ReplyKeyboardMarkup = {
    keyboard: Array<Array<KeyboardButton>>;
    is_persistent?: boolean;
    resize_keyboard?: boolean;
    one_time_keyboard?: boolean;
    input_field_placeholder?: string;
    selective?: boolean;
};

/**
 * This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.
 */
export type KeyboardButton = {
    text: string;
    request_users?: KeyboardButtonRequestUsers;
    request_chat?: KeyboardButtonRequestChat;
    request_contact?: boolean;
    request_location?: boolean;
    request_poll?: KeyboardButtonPollType;
    web_app?: WebAppInfo;
};

/**
 * This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »
 */
export type KeyboardButtonRequestUsers = {
    request_id: number;
    user_is_bot?: boolean;
    user_is_premium?: boolean;
    max_quantity?: number;
    request_name?: boolean;
    request_username?: boolean;
    request_photo?: boolean;
};

/**
 * This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. More about requesting chats ».
 */
export type KeyboardButtonRequestChat = {
    request_id: number;
    chat_is_channel: boolean;
    chat_is_forum?: boolean;
    chat_has_username?: boolean;
    chat_is_created?: boolean;
    user_administrator_rights?: ChatAdministratorRights;
    bot_administrator_rights?: ChatAdministratorRights;
    bot_is_member?: boolean;
    request_title?: boolean;
    request_username?: boolean;
    request_photo?: boolean;
};

/**
 * This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
 */
export type KeyboardButtonPollType = {
    type?: string;
};

/**
 * Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a Telegram Business account.
 */
export type ReplyKeyboardRemove = {
    remove_keyboard: boolean;
    selective?: boolean;
};

/**
 * This object represents an inline keyboard that appears right next to the message it belongs to.
 */
export type InlineKeyboardMarkup = {
    inline_keyboard: Array<Array<InlineKeyboardButton>>;
};

/**
 * This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.
 */
export type InlineKeyboardButton = {
    text: string;
    url?: string;
    callback_data?: string;
    web_app?: WebAppInfo;
    login_url?: LoginUrl;
    switch_inline_query?: string;
    switch_inline_query_current_chat?: string;
    switch_inline_query_chosen_chat?: SwitchInlineQueryChosenChat;
    copy_text?: CopyTextButton;
    callback_game?: CallbackGame;
    pay?: boolean;
};

/**
 * This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:
 * Telegram apps support these buttons as of version 5.7.
 */
export type LoginUrl = {
    url: string;
    forward_text?: string;
    bot_username?: string;
    request_write_access?: boolean;
};

/**
 * This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.
 */
export type SwitchInlineQueryChosenChat = {
    query?: string;
    allow_user_chats?: boolean;
    allow_bot_chats?: boolean;
    allow_group_chats?: boolean;
    allow_channel_chats?: boolean;
};

/**
 * This object represents an inline keyboard button that copies specified text to the clipboard.
 */
export type CopyTextButton = {
    text: string;
};

/**
 * This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
 */
export type CallbackQuery = {
    id: string;
    from: User;
    message?: MaybeInaccessibleMessage;
    inline_message_id?: string;
    chat_instance: string;
    data?: string;
    game_short_name?: string;
};

/**
 * Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a Telegram Business account.
 */
export type ForceReply = {
    force_reply: boolean;
    input_field_placeholder?: string;
    selective?: boolean;
};

/**
 * This object represents a chat photo.
 */
export type ChatPhoto = {
    small_file_id: string;
    small_file_unique_id: string;
    big_file_id: string;
    big_file_unique_id: string;
};

/**
 * Represents an invite link for a chat.
 */
export type ChatInviteLink = {
    invite_link: string;
    creator: User;
    creates_join_request: boolean;
    is_primary: boolean;
    is_revoked: boolean;
    name?: string;
    expire_date?: number;
    member_limit?: number;
    pending_join_request_count?: number;
    subscription_period?: number;
    subscription_price?: number;
};

/**
 * Represents the rights of an administrator in a chat.
 */
export type ChatAdministratorRights = {
    is_anonymous: boolean;
    can_manage_chat: boolean;
    can_delete_messages: boolean;
    can_manage_video_chats: boolean;
    can_restrict_members: boolean;
    can_promote_members: boolean;
    can_change_info: boolean;
    can_invite_users: boolean;
    can_post_stories: boolean;
    can_edit_stories: boolean;
    can_delete_stories: boolean;
    can_post_messages?: boolean;
    can_edit_messages?: boolean;
    can_pin_messages?: boolean;
    can_manage_topics?: boolean;
};

/**
 * This object represents changes in the status of a chat member.
 */
export type ChatMemberUpdated = {
    chat: Chat;
    from: User;
    date: number;
    old_chat_member: ChatMember;
    new_chat_member: ChatMember;
    invite_link?: ChatInviteLink;
    via_join_request?: boolean;
    via_chat_folder_invite_link?: boolean;
};

/**
 * This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
 */
export type ChatMember = ChatMemberOwner | ChatMemberAdministrator | ChatMemberMember | ChatMemberRestricted | ChatMemberLeft | ChatMemberBanned;

/**
 * Represents a chat member that owns the chat and has all administrator privileges.
 */
export type ChatMemberOwner = {
    status: string;
    user: User;
    is_anonymous: boolean;
    custom_title?: string;
};

/**
 * Represents a chat member that has some additional privileges.
 */
export type ChatMemberAdministrator = {
    status: string;
    user: User;
    can_be_edited: boolean;
    is_anonymous: boolean;
    can_manage_chat: boolean;
    can_delete_messages: boolean;
    can_manage_video_chats: boolean;
    can_restrict_members: boolean;
    can_promote_members: boolean;
    can_change_info: boolean;
    can_invite_users: boolean;
    can_post_stories: boolean;
    can_edit_stories: boolean;
    can_delete_stories: boolean;
    can_post_messages?: boolean;
    can_edit_messages?: boolean;
    can_pin_messages?: boolean;
    can_manage_topics?: boolean;
    custom_title?: string;
};

/**
 * Represents a chat member that has no additional privileges or restrictions.
 */
export type ChatMemberMember = {
    status: string;
    user: User;
    until_date?: number;
};

/**
 * Represents a chat member that is under certain restrictions in the chat. Supergroups only.
 */
export type ChatMemberRestricted = {
    status: string;
    user: User;
    is_member: boolean;
    can_send_messages: boolean;
    can_send_audios: boolean;
    can_send_documents: boolean;
    can_send_photos: boolean;
    can_send_videos: boolean;
    can_send_video_notes: boolean;
    can_send_voice_notes: boolean;
    can_send_polls: boolean;
    can_send_other_messages: boolean;
    can_add_web_page_previews: boolean;
    can_change_info: boolean;
    can_invite_users: boolean;
    can_pin_messages: boolean;
    can_manage_topics: boolean;
    until_date: number;
};

/**
 * Represents a chat member that isn't currently a member of the chat, but may join it themselves.
 */
export type ChatMemberLeft = {
    status: string;
    user: User;
};

/**
 * Represents a chat member that was banned in the chat and can't return to the chat or view chat messages.
 */
export type ChatMemberBanned = {
    status: string;
    user: User;
    until_date: number;
};

/**
 * Represents a join request sent to a chat.
 */
export type ChatJoinRequest = {
    chat: Chat;
    from: User;
    user_chat_id: number;
    date: number;
    bio?: string;
    invite_link?: ChatInviteLink;
};

/**
 * Describes actions that a non-administrator user is allowed to take in a chat.
 */
export type ChatPermissions = {
    can_send_messages?: boolean;
    can_send_audios?: boolean;
    can_send_documents?: boolean;
    can_send_photos?: boolean;
    can_send_videos?: boolean;
    can_send_video_notes?: boolean;
    can_send_voice_notes?: boolean;
    can_send_polls?: boolean;
    can_send_other_messages?: boolean;
    can_add_web_page_previews?: boolean;
    can_change_info?: boolean;
    can_invite_users?: boolean;
    can_pin_messages?: boolean;
    can_manage_topics?: boolean;
};

/**
 * Describes the birthdate of a user.
 */
export type Birthdate = {
    day: number;
    month: number;
    year?: number;
};

/**
 * Contains information about the start page settings of a Telegram Business account.
 */
export type BusinessIntro = {
    title?: string;
    message?: string;
    sticker?: Sticker;
};

/**
 * Contains information about the location of a Telegram Business account.
 */
export type BusinessLocation = {
    address: string;
    location?: Location;
};

/**
 * Describes an interval of time during which a business is open.
 */
export type BusinessOpeningHoursInterval = {
    opening_minute: number;
    closing_minute: number;
};

/**
 * Describes the opening hours of a business.
 */
export type BusinessOpeningHours = {
    time_zone_name: string;
    opening_hours: Array<BusinessOpeningHoursInterval>;
};

/**
 * Describes the position of a clickable area within a story.
 */
export type StoryAreaPosition = {
    x_percentage: number;
    y_percentage: number;
    width_percentage: number;
    height_percentage: number;
    rotation_angle: number;
    corner_radius_percentage: number;
};

/**
 * Describes the physical address of a location.
 */
export type LocationAddress = {
    country_code: string;
    state?: string;
    city?: string;
    street?: string;
};

/**
 * Describes the type of a clickable area on a story. Currently, it can be one of
 */
export type StoryAreaType = StoryAreaTypeLocation | StoryAreaTypeSuggestedReaction | StoryAreaTypeLink | StoryAreaTypeWeather | StoryAreaTypeUniqueGift;

/**
 * Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.
 */
export type StoryAreaTypeLocation = {
    type: string;
    latitude: number;
    longitude: number;
    address?: LocationAddress;
};

/**
 * Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.
 */
export type StoryAreaTypeSuggestedReaction = {
    type: string;
    reaction_type: ReactionType;
    is_dark?: boolean;
    is_flipped?: boolean;
};

/**
 * Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.
 */
export type StoryAreaTypeLink = {
    type: string;
    url: string;
};

/**
 * Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.
 */
export type StoryAreaTypeWeather = {
    type: string;
    temperature: number;
    emoji: string;
    background_color: number;
};

/**
 * Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.
 */
export type StoryAreaTypeUniqueGift = {
    type: string;
    name: string;
};

/**
 * Describes a clickable area on a story media.
 */
export type StoryArea = {
    position: StoryAreaPosition;
    type: StoryAreaType;
};

/**
 * Represents a location to which a chat is connected.
 */
export type ChatLocation = {
    location: Location;
    address: string;
};

/**
 * This object describes the type of a reaction. Currently, it can be one of
 */
export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid;

/**
 * The reaction is based on an emoji.
 */
export type ReactionTypeEmoji = {
    type: string;
    emoji: string;
};

/**
 * The reaction is based on a custom emoji.
 */
export type ReactionTypeCustomEmoji = {
    type: string;
    custom_emoji_id: string;
};

/**
 * The reaction is paid.
 */
export type ReactionTypePaid = {
    type: string;
};

/**
 * Represents a reaction added to a message along with the number of times it was added.
 */
export type ReactionCount = {
    type: ReactionType;
    total_count: number;
};

/**
 * This object represents a change of a reaction on a message performed by a user.
 */
export type MessageReactionUpdated = {
    chat: Chat;
    message_id: number;
    user?: User;
    actor_chat?: Chat;
    date: number;
    old_reaction: Array<ReactionType>;
    new_reaction: Array<ReactionType>;
};

/**
 * This object represents reaction changes on a message with anonymous reactions.
 */
export type MessageReactionCountUpdated = {
    chat: Chat;
    message_id: number;
    date: number;
    reactions: Array<ReactionCount>;
};

/**
 * This object represents a forum topic.
 */
export type ForumTopic = {
    message_thread_id: number;
    name: string;
    icon_color: number;
    icon_custom_emoji_id?: string;
};

/**
 * This object represents a gift that can be sent by the bot.
 */
export type Gift = {
    id: string;
    sticker: Sticker;
    star_count: number;
    upgrade_star_count?: number;
    total_count?: number;
    remaining_count?: number;
};

/**
 * This object represent a list of gifts.
 */
export type Gifts = {
    gifts: Array<Gift>;
};

/**
 * This object describes the model of a unique gift.
 */
export type UniqueGiftModel = {
    name: string;
    sticker: Sticker;
    rarity_per_mille: number;
};

/**
 * This object describes the symbol shown on the pattern of a unique gift.
 */
export type UniqueGiftSymbol = {
    name: string;
    sticker: Sticker;
    rarity_per_mille: number;
};

/**
 * This object describes the colors of the backdrop of a unique gift.
 */
export type UniqueGiftBackdropColors = {
    center_color: number;
    edge_color: number;
    symbol_color: number;
    text_color: number;
};

/**
 * This object describes the backdrop of a unique gift.
 */
export type UniqueGiftBackdrop = {
    name: string;
    colors: UniqueGiftBackdropColors;
    rarity_per_mille: number;
};

/**
 * This object describes a unique gift that was upgraded from a regular gift.
 */
export type UniqueGift = {
    base_name: string;
    name: string;
    number: number;
    model: UniqueGiftModel;
    symbol: UniqueGiftSymbol;
    backdrop: UniqueGiftBackdrop;
};

/**
 * Describes a service message about a regular gift that was sent or received.
 */
export type GiftInfo = {
    gift: Gift;
    owned_gift_id?: string;
    convert_star_count?: number;
    prepaid_upgrade_star_count?: number;
    can_be_upgraded?: boolean;
    text?: string;
    entities?: Array<MessageEntity>;
    is_private?: boolean;
};

/**
 * Describes a service message about a unique gift that was sent or received.
 */
export type UniqueGiftInfo = {
    gift: UniqueGift;
    origin: string;
    owned_gift_id?: string;
    transfer_star_count?: number;
};

/**
 * This object describes a gift received and owned by a user or a chat. Currently, it can be one of
 */
export type OwnedGift = OwnedGiftRegular | OwnedGiftUnique;

/**
 * Describes a regular gift owned by a user or a chat.
 */
export type OwnedGiftRegular = {
    type: string;
    gift: Gift;
    owned_gift_id?: string;
    sender_user?: User;
    send_date: number;
    text?: string;
    entities?: Array<MessageEntity>;
    is_private?: boolean;
    is_saved?: boolean;
    can_be_upgraded?: boolean;
    was_refunded?: boolean;
    convert_star_count?: number;
    prepaid_upgrade_star_count?: number;
};

/**
 * Describes a unique gift received and owned by a user or a chat.
 */
export type OwnedGiftUnique = {
    type: string;
    gift: UniqueGift;
    owned_gift_id?: string;
    sender_user?: User;
    send_date: number;
    is_saved?: boolean;
    can_be_transferred?: boolean;
    transfer_star_count?: number;
};

/**
 * Contains the list of gifts received and owned by a user or a chat.
 */
export type OwnedGifts = {
    total_count: number;
    gifts: Array<OwnedGift>;
    next_offset?: string;
};

/**
 * This object describes the types of gifts that can be gifted to a user or a chat.
 */
export type AcceptedGiftTypes = {
    unlimited_gifts: boolean;
    limited_gifts: boolean;
    unique_gifts: boolean;
    premium_subscription: boolean;
};

/**
 * Describes an amount of Telegram Stars.
 */
export type StarAmount = {
    amount: number;
    nanostar_amount?: number;
};

/**
 * This object represents a bot command.
 */
export type BotCommand = {
    command: string;
    description: string;
};

/**
 * This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
 */
export type BotCommandScope = BotCommandScopeDefault | BotCommandScopeAllPrivateChats | BotCommandScopeAllGroupChats | BotCommandScopeAllChatAdministrators | BotCommandScopeChat | BotCommandScopeChatAdministrators | BotCommandScopeChatMember;

/**
 * Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.
 */
export type BotCommandScopeDefault = {
    type: string;
};

/**
 * Represents the scope of bot commands, covering all private chats.
 */
export type BotCommandScopeAllPrivateChats = {
    type: string;
};

/**
 * Represents the scope of bot commands, covering all group and supergroup chats.
 */
export type BotCommandScopeAllGroupChats = {
    type: string;
};

/**
 * Represents the scope of bot commands, covering all group and supergroup chat administrators.
 */
export type BotCommandScopeAllChatAdministrators = {
    type: string;
};

/**
 * Represents the scope of bot commands, covering a specific chat.
 */
export type BotCommandScopeChat = {
    type: string;
    chat_id: number | string;
};

/**
 * Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
 */
export type BotCommandScopeChatAdministrators = {
    type: string;
    chat_id: number | string;
};

/**
 * Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
 */
export type BotCommandScopeChatMember = {
    type: string;
    chat_id: number | string;
    user_id: number;
};

/**
 * This object represents the bot's name.
 */
export type BotName = {
    name: string;
};

/**
 * This object represents the bot's description.
 */
export type BotDescription = {
    description: string;
};

/**
 * This object represents the bot's short description.
 */
export type BotShortDescription = {
    short_description: string;
};

/**
 * This object describes the bot's menu button in a private chat. It should be one of
 */
export type MenuButton = MenuButtonCommands | MenuButtonWebApp | MenuButtonDefault;

/**
 * Represents a menu button, which opens the bot's list of commands.
 */
export type MenuButtonCommands = {
    type: string;
};

/**
 * Represents a menu button, which launches a Web App.
 */
export type MenuButtonWebApp = {
    type: string;
    text: string;
    web_app: WebAppInfo;
};

/**
 * Describes that no specific value for the menu button was set.
 */
export type MenuButtonDefault = {
    type: string;
};

/**
 * This object describes the source of a chat boost. It can be one of
 */
export type ChatBoostSource = ChatBoostSourcePremium | ChatBoostSourceGiftCode | ChatBoostSourceGiveaway;

/**
 * The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.
 */
export type ChatBoostSourcePremium = {
    source: string;
    user: User;
};

/**
 * The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.
 */
export type ChatBoostSourceGiftCode = {
    source: string;
    user: User;
};

/**
 * The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways.
 */
export type ChatBoostSourceGiveaway = {
    source: string;
    giveaway_message_id: number;
    user?: User;
    prize_star_count?: number;
    is_unclaimed?: boolean;
};

/**
 * This object contains information about a chat boost.
 */
export type ChatBoost = {
    boost_id: string;
    add_date: number;
    expiration_date: number;
    source: ChatBoostSource;
};

/**
 * This object represents a boost added to a chat or changed.
 */
export type ChatBoostUpdated = {
    chat: Chat;
    boost: ChatBoost;
};

/**
 * This object represents a boost removed from a chat.
 */
export type ChatBoostRemoved = {
    chat: Chat;
    boost_id: string;
    remove_date: number;
    source: ChatBoostSource;
};

/**
 * This object represents a list of boosts added to a chat by a user.
 */
export type UserChatBoosts = {
    boosts: Array<ChatBoost>;
};

/**
 * Represents the rights of a business bot.
 */
export type BusinessBotRights = {
    can_reply?: boolean;
    can_read_messages?: boolean;
    can_delete_outgoing_messages?: boolean;
    can_delete_all_messages?: boolean;
    can_edit_name?: boolean;
    can_edit_bio?: boolean;
    can_edit_profile_photo?: boolean;
    can_edit_username?: boolean;
    can_change_gift_settings?: boolean;
    can_view_gifts_and_stars?: boolean;
    can_convert_gifts_to_stars?: boolean;
    can_transfer_and_upgrade_gifts?: boolean;
    can_transfer_stars?: boolean;
    can_manage_stories?: boolean;
};

/**
 * Describes the connection of the bot with a business account.
 */
export type BusinessConnection = {
    id: string;
    user: User;
    user_chat_id: number;
    date: number;
    rights?: BusinessBotRights;
    is_enabled: boolean;
};

/**
 * This object is received when messages are deleted from a connected business account.
 */
export type BusinessMessagesDeleted = {
    business_connection_id: string;
    chat: Chat;
    message_ids: Array<number>;
};

/**
 * Describes why a request was unsuccessful.
 */
export type ResponseParameters = {
    migrate_to_chat_id?: number;
    retry_after?: number;
};

/**
 * This object represents the content of a media message to be sent. It should be one of
 */
export type InputMedia = InputMediaAnimation | InputMediaDocument | InputMediaAudio | InputMediaPhoto | InputMediaVideo;

/**
 * Represents a photo to be sent.
 */
export type InputMediaPhoto = {
    type: string;
    media: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    has_spoiler?: boolean;
};

/**
 * Represents a video to be sent.
 */
export type InputMediaVideo = {
    type: string;
    media: string;
    thumbnail?: string;
    cover?: string;
    start_timestamp?: number;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    width?: number;
    height?: number;
    duration?: number;
    supports_streaming?: boolean;
    has_spoiler?: boolean;
};

/**
 * Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
 */
export type InputMediaAnimation = {
    type: string;
    media: string;
    thumbnail?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    width?: number;
    height?: number;
    duration?: number;
    has_spoiler?: boolean;
};

/**
 * Represents an audio file to be treated as music to be sent.
 */
export type InputMediaAudio = {
    type: string;
    media: string;
    thumbnail?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    duration?: number;
    performer?: string;
    title?: string;
};

/**
 * Represents a general file to be sent.
 */
export type InputMediaDocument = {
    type: string;
    media: string;
    thumbnail?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    disable_content_type_detection?: boolean;
};

/**
 * This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.
 */
export type InputFile = {
    [key: string]: unknown;
};

/**
 * This object describes the paid media to be sent. Currently, it can be one of
 */
export type InputPaidMedia = InputPaidMediaPhoto | InputPaidMediaVideo;

/**
 * The paid media to send is a photo.
 */
export type InputPaidMediaPhoto = {
    type: string;
    media: string;
};

/**
 * The paid media to send is a video.
 */
export type InputPaidMediaVideo = {
    type: string;
    media: string;
    thumbnail?: string;
    cover?: string;
    start_timestamp?: number;
    width?: number;
    height?: number;
    duration?: number;
    supports_streaming?: boolean;
};

/**
 * This object describes a profile photo to set. Currently, it can be one of
 */
export type InputProfilePhoto = InputProfilePhotoStatic | InputProfilePhotoAnimated;

/**
 * A static profile photo in the .JPG format.
 */
export type InputProfilePhotoStatic = {
    type: string;
    photo: string;
};

/**
 * An animated profile photo in the MPEG4 format.
 */
export type InputProfilePhotoAnimated = {
    type: string;
    animation: string;
    main_frame_timestamp?: number;
};

/**
 * This object describes the content of a story to post. Currently, it can be one of
 */
export type InputStoryContent = InputStoryContentPhoto | InputStoryContentVideo;

/**
 * Describes a photo to post as a story.
 */
export type InputStoryContentPhoto = {
    type: string;
    photo: string;
};

/**
 * Describes a video to post as a story.
 */
export type InputStoryContentVideo = {
    type: string;
    video: string;
    duration?: number;
    cover_frame_timestamp?: number;
    is_animation?: boolean;
};

/**
 * This object represents a sticker.
 */
export type Sticker = {
    file_id: string;
    file_unique_id: string;
    type: string;
    width: number;
    height: number;
    is_animated: boolean;
    is_video: boolean;
    thumbnail?: PhotoSize;
    emoji?: string;
    set_name?: string;
    premium_animation?: File;
    mask_position?: MaskPosition;
    custom_emoji_id?: string;
    needs_repainting?: boolean;
    file_size?: number;
};

/**
 * This object represents a sticker set.
 */
export type StickerSet = {
    name: string;
    title: string;
    sticker_type: string;
    stickers: Array<Sticker>;
    thumbnail?: PhotoSize;
};

/**
 * This object describes the position on faces where a mask should be placed by default.
 */
export type MaskPosition = {
    point: string;
    x_shift: number;
    y_shift: number;
    scale: number;
};

/**
 * This object describes a sticker to be added to a sticker set.
 */
export type InputSticker = {
    sticker: string;
    format: string;
    emoji_list: Array<string>;
    mask_position?: MaskPosition;
    keywords?: Array<string>;
};

/**
 * This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
 */
export type InlineQuery = {
    id: string;
    from: User;
    query: string;
    offset: string;
    chat_type?: string;
    location?: Location;
};

/**
 * This object represents a button to be shown above inline query results. You must use exactly one of the optional fields.
 */
export type InlineQueryResultsButton = {
    text: string;
    web_app?: WebAppInfo;
    start_parameter?: string;
};

/**
 * This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:
 */
export type InlineQueryResult = InlineQueryResultCachedAudio | InlineQueryResultCachedDocument | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedPhoto | InlineQueryResultCachedSticker | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultArticle | InlineQueryResultAudio | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultDocument | InlineQueryResultGif | InlineQueryResultLocation | InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVenue | InlineQueryResultVideo | InlineQueryResultVoice;

/**
 * Represents a link to an article or web page.
 */
export type InlineQueryResultArticle = {
    type: string;
    id: string;
    title: string;
    input_message_content: InputMessageContent;
    reply_markup?: InlineKeyboardMarkup;
    url?: string;
    description?: string;
    thumbnail_url?: string;
    thumbnail_width?: number;
    thumbnail_height?: number;
};

/**
 * Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
 */
export type InlineQueryResultPhoto = {
    type: string;
    id: string;
    photo_url: string;
    thumbnail_url: string;
    photo_width?: number;
    photo_height?: number;
    title?: string;
    description?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
 */
export type InlineQueryResultGif = {
    type: string;
    id: string;
    gif_url: string;
    gif_width?: number;
    gif_height?: number;
    gif_duration?: number;
    thumbnail_url: string;
    thumbnail_mime_type?: string;
    title?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
 */
export type InlineQueryResultMpeg4Gif = {
    type: string;
    id: string;
    mpeg4_url: string;
    mpeg4_width?: number;
    mpeg4_height?: number;
    mpeg4_duration?: number;
    thumbnail_url: string;
    thumbnail_mime_type?: string;
    title?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
 */
export type InlineQueryResultVideo = {
    type: string;
    id: string;
    video_url: string;
    mime_type: string;
    thumbnail_url: string;
    title: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    video_width?: number;
    video_height?: number;
    video_duration?: number;
    description?: string;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.
 */
export type InlineQueryResultAudio = {
    type: string;
    id: string;
    audio_url: string;
    title: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    performer?: string;
    audio_duration?: number;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.
 */
export type InlineQueryResultVoice = {
    type: string;
    id: string;
    voice_url: string;
    title: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    voice_duration?: number;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.
 */
export type InlineQueryResultDocument = {
    type: string;
    id: string;
    title: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    document_url: string;
    mime_type: string;
    description?: string;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
    thumbnail_url?: string;
    thumbnail_width?: number;
    thumbnail_height?: number;
};

/**
 * Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.
 */
export type InlineQueryResultLocation = {
    type: string;
    id: string;
    latitude: number;
    longitude: number;
    title: string;
    horizontal_accuracy?: number;
    live_period?: number;
    heading?: number;
    proximity_alert_radius?: number;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
    thumbnail_url?: string;
    thumbnail_width?: number;
    thumbnail_height?: number;
};

/**
 * Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.
 */
export type InlineQueryResultVenue = {
    type: string;
    id: string;
    latitude: number;
    longitude: number;
    title: string;
    address: string;
    foursquare_id?: string;
    foursquare_type?: string;
    google_place_id?: string;
    google_place_type?: string;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
    thumbnail_url?: string;
    thumbnail_width?: number;
    thumbnail_height?: number;
};

/**
 * Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.
 */
export type InlineQueryResultContact = {
    type: string;
    id: string;
    phone_number: string;
    first_name: string;
    last_name?: string;
    vcard?: string;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
    thumbnail_url?: string;
    thumbnail_width?: number;
    thumbnail_height?: number;
};

/**
 * Represents a Game.
 */
export type InlineQueryResultGame = {
    type: string;
    id: string;
    game_short_name: string;
    reply_markup?: InlineKeyboardMarkup;
};

/**
 * Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
 */
export type InlineQueryResultCachedPhoto = {
    type: string;
    id: string;
    photo_file_id: string;
    title?: string;
    description?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation.
 */
export type InlineQueryResultCachedGif = {
    type: string;
    id: string;
    gif_file_id: string;
    title?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
 */
export type InlineQueryResultCachedMpeg4Gif = {
    type: string;
    id: string;
    mpeg4_file_id: string;
    title?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.
 */
export type InlineQueryResultCachedSticker = {
    type: string;
    id: string;
    sticker_file_id: string;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.
 */
export type InlineQueryResultCachedDocument = {
    type: string;
    id: string;
    title: string;
    document_file_id: string;
    description?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
 */
export type InlineQueryResultCachedVideo = {
    type: string;
    id: string;
    video_file_id: string;
    title: string;
    description?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.
 */
export type InlineQueryResultCachedVoice = {
    type: string;
    id: string;
    voice_file_id: string;
    title: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.
 */
export type InlineQueryResultCachedAudio = {
    type: string;
    id: string;
    audio_file_id: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    reply_markup?: InlineKeyboardMarkup;
    input_message_content?: InputMessageContent;
};

/**
 * This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types:
 */
export type InputMessageContent = InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent;

/**
 * Represents the content of a text message to be sent as the result of an inline query.
 */
export type InputTextMessageContent = {
    message_text: string;
    parse_mode?: string;
    entities?: Array<MessageEntity>;
    link_preview_options?: LinkPreviewOptions;
};

/**
 * Represents the content of a location message to be sent as the result of an inline query.
 */
export type InputLocationMessageContent = {
    latitude: number;
    longitude: number;
    horizontal_accuracy?: number;
    live_period?: number;
    heading?: number;
    proximity_alert_radius?: number;
};

/**
 * Represents the content of a venue message to be sent as the result of an inline query.
 */
export type InputVenueMessageContent = {
    latitude: number;
    longitude: number;
    title: string;
    address: string;
    foursquare_id?: string;
    foursquare_type?: string;
    google_place_id?: string;
    google_place_type?: string;
};

/**
 * Represents the content of a contact message to be sent as the result of an inline query.
 */
export type InputContactMessageContent = {
    phone_number: string;
    first_name: string;
    last_name?: string;
    vcard?: string;
};

/**
 * Represents the content of an invoice message to be sent as the result of an inline query.
 */
export type InputInvoiceMessageContent = {
    title: string;
    description: string;
    payload: string;
    provider_token?: string;
    currency: string;
    prices: Array<LabeledPrice>;
    max_tip_amount?: number;
    suggested_tip_amounts?: Array<number>;
    provider_data?: string;
    photo_url?: string;
    photo_size?: number;
    photo_width?: number;
    photo_height?: number;
    need_name?: boolean;
    need_phone_number?: boolean;
    need_email?: boolean;
    need_shipping_address?: boolean;
    send_phone_number_to_provider?: boolean;
    send_email_to_provider?: boolean;
    is_flexible?: boolean;
};

/**
 * Represents a result of an inline query that was chosen by the user and sent to their chat partner.
 */
export type ChosenInlineResult = {
    result_id: string;
    from: User;
    location?: Location;
    inline_message_id?: string;
    query: string;
};

/**
 * Describes an inline message sent by a Web App on behalf of a user.
 */
export type SentWebAppMessage = {
    inline_message_id?: string;
};

/**
 * Describes an inline message to be sent by a user of a Mini App.
 */
export type PreparedInlineMessage = {
    id: string;
    expiration_date: number;
};

/**
 * This object represents a portion of the price for goods or services.
 */
export type LabeledPrice = {
    label: string;
    amount: number;
};

/**
 * This object contains basic information about an invoice.
 */
export type Invoice = {
    title: string;
    description: string;
    start_parameter: string;
    currency: string;
    total_amount: number;
};

/**
 * This object represents a shipping address.
 */
export type ShippingAddress = {
    country_code: string;
    state: string;
    city: string;
    street_line1: string;
    street_line2: string;
    post_code: string;
};

/**
 * This object represents information about an order.
 */
export type OrderInfo = {
    name?: string;
    phone_number?: string;
    email?: string;
    shipping_address?: ShippingAddress;
};

/**
 * This object represents one shipping option.
 */
export type ShippingOption = {
    id: string;
    title: string;
    prices: Array<LabeledPrice>;
};

/**
 * This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control.
 */
export type SuccessfulPayment = {
    currency: string;
    total_amount: number;
    invoice_payload: string;
    subscription_expiration_date?: number;
    is_recurring?: boolean;
    is_first_recurring?: boolean;
    shipping_option_id?: string;
    order_info?: OrderInfo;
    telegram_payment_charge_id: string;
    provider_payment_charge_id: string;
};

/**
 * This object contains basic information about a refunded payment.
 */
export type RefundedPayment = {
    currency: string;
    total_amount: number;
    invoice_payload: string;
    telegram_payment_charge_id: string;
    provider_payment_charge_id?: string;
};

/**
 * This object contains information about an incoming shipping query.
 */
export type ShippingQuery = {
    id: string;
    from: User;
    invoice_payload: string;
    shipping_address: ShippingAddress;
};

/**
 * This object contains information about an incoming pre-checkout query.
 */
export type PreCheckoutQuery = {
    id: string;
    from: User;
    currency: string;
    total_amount: number;
    invoice_payload: string;
    shipping_option_id?: string;
    order_info?: OrderInfo;
};

/**
 * This object contains information about a paid media purchase.
 */
export type PaidMediaPurchased = {
    from: User;
    paid_media_payload: string;
};

/**
 * This object describes the state of a revenue withdrawal operation. Currently, it can be one of
 */
export type RevenueWithdrawalState = RevenueWithdrawalStatePending | RevenueWithdrawalStateSucceeded | RevenueWithdrawalStateFailed;

/**
 * The withdrawal is in progress.
 */
export type RevenueWithdrawalStatePending = {
    type: string;
};

/**
 * The withdrawal succeeded.
 */
export type RevenueWithdrawalStateSucceeded = {
    type: string;
    date: number;
    url: string;
};

/**
 * The withdrawal failed and the transaction was refunded.
 */
export type RevenueWithdrawalStateFailed = {
    type: string;
};

/**
 * Contains information about the affiliate that received a commission via this transaction.
 */
export type AffiliateInfo = {
    affiliate_user?: User;
    affiliate_chat?: Chat;
    commission_per_mille: number;
    amount: number;
    nanostar_amount?: number;
};

/**
 * This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
 */
export type TransactionPartner = TransactionPartnerUser | TransactionPartnerChat | TransactionPartnerAffiliateProgram | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerTelegramApi | TransactionPartnerOther;

/**
 * Describes a transaction with a user.
 */
export type TransactionPartnerUser = {
    type: string;
    transaction_type: string;
    user: User;
    affiliate?: AffiliateInfo;
    invoice_payload?: string;
    subscription_period?: number;
    paid_media?: Array<PaidMedia>;
    paid_media_payload?: string;
    gift?: Gift;
    premium_subscription_duration?: number;
};

/**
 * Describes a transaction with a chat.
 */
export type TransactionPartnerChat = {
    type: string;
    chat: Chat;
    gift?: Gift;
};

/**
 * Describes the affiliate program that issued the affiliate commission received via this transaction.
 */
export type TransactionPartnerAffiliateProgram = {
    type: string;
    sponsor_user?: User;
    commission_per_mille: number;
};

/**
 * Describes a withdrawal transaction with Fragment.
 */
export type TransactionPartnerFragment = {
    type: string;
    withdrawal_state?: RevenueWithdrawalState;
};

/**
 * Describes a withdrawal transaction to the Telegram Ads platform.
 */
export type TransactionPartnerTelegramAds = {
    type: string;
};

/**
 * Describes a transaction with payment for paid broadcasting.
 */
export type TransactionPartnerTelegramApi = {
    type: string;
    request_count: number;
};

/**
 * Describes a transaction with an unknown source or recipient.
 */
export type TransactionPartnerOther = {
    type: string;
};

/**
 * Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.
 */
export type StarTransaction = {
    id: string;
    amount: number;
    nanostar_amount?: number;
    date: number;
    source?: TransactionPartner;
    receiver?: TransactionPartner;
};

/**
 * Contains a list of Telegram Star transactions.
 */
export type StarTransactions = {
    transactions: Array<StarTransaction>;
};

/**
 * Describes Telegram Passport data shared with the bot by the user.
 */
export type PassportData = {
    data: Array<EncryptedPassportElement>;
    credentials: EncryptedCredentials;
};

/**
 * This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.
 */
export type PassportFile = {
    file_id: string;
    file_unique_id: string;
    file_size: number;
    file_date: number;
};

/**
 * Describes documents or other Telegram Passport elements shared with the bot by the user.
 */
export type EncryptedPassportElement = {
    type: string;
    data?: string;
    phone_number?: string;
    email?: string;
    files?: Array<PassportFile>;
    front_side?: PassportFile;
    reverse_side?: PassportFile;
    selfie?: PassportFile;
    translation?: Array<PassportFile>;
    hash: string;
};

/**
 * Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
 */
export type EncryptedCredentials = {
    data: string;
    hash: string;
    secret: string;
};

/**
 * This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:
 */
export type PassportElementError = PassportElementErrorDataField | PassportElementErrorFrontSide | PassportElementErrorReverseSide | PassportElementErrorSelfie | PassportElementErrorFile | PassportElementErrorFiles | PassportElementErrorTranslationFile | PassportElementErrorTranslationFiles | PassportElementErrorUnspecified;

/**
 * Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.
 */
export type PassportElementErrorDataField = {
    source: string;
    type: string;
    field_name: string;
    data_hash: string;
    message: string;
};

/**
 * Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.
 */
export type PassportElementErrorFrontSide = {
    source: string;
    type: string;
    file_hash: string;
    message: string;
};

/**
 * Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.
 */
export type PassportElementErrorReverseSide = {
    source: string;
    type: string;
    file_hash: string;
    message: string;
};

/**
 * Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.
 */
export type PassportElementErrorSelfie = {
    source: string;
    type: string;
    file_hash: string;
    message: string;
};

/**
 * Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
 */
export type PassportElementErrorFile = {
    source: string;
    type: string;
    file_hash: string;
    message: string;
};

/**
 * Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
 */
export type PassportElementErrorFiles = {
    source: string;
    type: string;
    file_hashes: Array<string>;
    message: string;
};

/**
 * Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.
 */
export type PassportElementErrorTranslationFile = {
    source: string;
    type: string;
    file_hash: string;
    message: string;
};

/**
 * Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.
 */
export type PassportElementErrorTranslationFiles = {
    source: string;
    type: string;
    file_hashes: Array<string>;
    message: string;
};

/**
 * Represents an issue in an unspecified place. The error is considered resolved when new data is added.
 */
export type PassportElementErrorUnspecified = {
    source: string;
    type: string;
    element_hash: string;
    message: string;
};

/**
 * This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
 */
export type Game = {
    title: string;
    description: string;
    photo: Array<PhotoSize>;
    text?: string;
    text_entities?: Array<MessageEntity>;
    animation?: Animation;
};

/**
 * A placeholder, currently holds no information. Use BotFather to set up your game.
 */
export type CallbackGame = {
    [key: string]: unknown;
};

/**
 * This object represents one row of the high scores table for a game.
 */
export type GameHighScore = {
    position: number;
    user: User;
    score: number;
};

export type GetUpdatesData = {
    offset?: number;
    limit?: number;
    timeout?: number;
    allowed_updates?: Array<string>;
};

export type GetUpdatesResponse = Success & {
    result?: Array<Update>;
};

export type SetWebhookData = {
    url: string;
    certificate?: InputFile;
    ip_address?: string;
    max_connections?: number;
    allowed_updates?: Array<string>;
    drop_pending_updates?: boolean;
    secret_token?: string;
};

export type SetWebhookResponse = Success & {
    result?: boolean;
};

export type DeleteWebhookData = {
    drop_pending_updates?: boolean;
};

export type DeleteWebhookResponse = Success & {
    result?: boolean;
};

export type GetWebhookInfoData = {
    [key: string]: unknown;
};

export type GetWebhookInfoResponse = Success & {
    result?: WebhookInfo;
};

export type GetMeData = {
    [key: string]: unknown;
};

export type GetMeResponse = Success & {
    result?: User;
};

export type LogOutData = {
    [key: string]: unknown;
};

export type LogOutResponse = Success & {
    result?: boolean;
};

export type CloseData = {
    [key: string]: unknown;
};

export type CloseResponse = Success & {
    result?: boolean;
};

export type SendMessageData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    text: string;
    parse_mode?: string;
    entities?: Array<MessageEntity>;
    link_preview_options?: LinkPreviewOptions;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendMessageResponse = Success & {
    result?: Message;
};

export type ForwardMessageData = {
    chat_id: number | string;
    message_thread_id?: number;
    from_chat_id: number | string;
    video_start_timestamp?: number;
    disable_notification?: boolean;
    protect_content?: boolean;
    message_id: number;
};

export type ForwardMessageResponse = Success & {
    result?: Message;
};

export type ForwardMessagesData = {
    chat_id: number | string;
    message_thread_id?: number;
    from_chat_id: number | string;
    message_ids: Array<number>;
    disable_notification?: boolean;
    protect_content?: boolean;
};

export type ForwardMessagesResponse = Success & {
    result?: Array<MessageId>;
};

export type CopyMessageData = {
    chat_id: number | string;
    message_thread_id?: number;
    from_chat_id: number | string;
    message_id: number;
    video_start_timestamp?: number;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type CopyMessageResponse = Success & {
    result?: MessageId;
};

export type CopyMessagesData = {
    chat_id: number | string;
    message_thread_id?: number;
    from_chat_id: number | string;
    message_ids: Array<number>;
    disable_notification?: boolean;
    protect_content?: boolean;
    remove_caption?: boolean;
};

export type CopyMessagesResponse = Success & {
    result?: Array<MessageId>;
};

export type SendPhotoData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    photo: InputFile | string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    has_spoiler?: boolean;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendPhotoResponse = Success & {
    result?: Message;
};

export type SendAudioData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    audio: InputFile | string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    duration?: number;
    performer?: string;
    title?: string;
    thumbnail?: InputFile | string;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendAudioResponse = Success & {
    result?: Message;
};

export type SendDocumentData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    document: InputFile | string;
    thumbnail?: InputFile | string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    disable_content_type_detection?: boolean;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendDocumentResponse = Success & {
    result?: Message;
};

export type SendVideoData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    video: InputFile | string;
    duration?: number;
    width?: number;
    height?: number;
    thumbnail?: InputFile | string;
    cover?: InputFile | string;
    start_timestamp?: number;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    has_spoiler?: boolean;
    supports_streaming?: boolean;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendVideoResponse = Success & {
    result?: Message;
};

export type SendAnimationData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    animation: InputFile | string;
    duration?: number;
    width?: number;
    height?: number;
    thumbnail?: InputFile | string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    has_spoiler?: boolean;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendAnimationResponse = Success & {
    result?: Message;
};

export type SendVoiceData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    voice: InputFile | string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    duration?: number;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendVoiceResponse = Success & {
    result?: Message;
};

export type SendVideoNoteData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    video_note: InputFile | string;
    duration?: number;
    length?: number;
    thumbnail?: InputFile | string;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendVideoNoteResponse = Success & {
    result?: Message;
};

export type SendPaidMediaData = {
    business_connection_id?: string;
    chat_id: number | string;
    star_count: number;
    media: Array<InputPaidMedia>;
    payload?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendPaidMediaResponse = Success & {
    result?: Message;
};

export type SendMediaGroupData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    media: Array<InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo>;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
};

export type SendMediaGroupResponse = Success & {
    result?: Array<Message>;
};

export type SendLocationData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    latitude: number;
    longitude: number;
    horizontal_accuracy?: number;
    live_period?: number;
    heading?: number;
    proximity_alert_radius?: number;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendLocationResponse = Success & {
    result?: Message;
};

export type SendVenueData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    latitude: number;
    longitude: number;
    title: string;
    address: string;
    foursquare_id?: string;
    foursquare_type?: string;
    google_place_id?: string;
    google_place_type?: string;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendVenueResponse = Success & {
    result?: Message;
};

export type SendContactData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    phone_number: string;
    first_name: string;
    last_name?: string;
    vcard?: string;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendContactResponse = Success & {
    result?: Message;
};

export type SendPollData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    question: string;
    question_parse_mode?: string;
    question_entities?: Array<MessageEntity>;
    options: Array<InputPollOption>;
    is_anonymous?: boolean;
    type?: string;
    allows_multiple_answers?: boolean;
    correct_option_id?: number;
    explanation?: string;
    explanation_parse_mode?: string;
    explanation_entities?: Array<MessageEntity>;
    open_period?: number;
    close_date?: number;
    is_closed?: boolean;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendPollResponse = Success & {
    result?: Message;
};

export type SendDiceData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    emoji?: string;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendDiceResponse = Success & {
    result?: Message;
};

export type SendChatActionData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    action: string;
};

export type SendChatActionResponse = Success & {
    result?: boolean;
};

export type SetMessageReactionData = {
    chat_id: number | string;
    message_id: number;
    reaction?: Array<ReactionType>;
    is_big?: boolean;
};

export type SetMessageReactionResponse = Success & {
    result?: boolean;
};

export type GetUserProfilePhotosData = {
    user_id: number;
    offset?: number;
    limit?: number;
};

export type GetUserProfilePhotosResponse = Success & {
    result?: UserProfilePhotos;
};

export type SetUserEmojiStatusData = {
    user_id: number;
    emoji_status_custom_emoji_id?: string;
    emoji_status_expiration_date?: number;
};

export type SetUserEmojiStatusResponse = Success & {
    result?: boolean;
};

export type GetFileData = {
    file_id: string;
};

export type GetFileResponse = Success & {
    result?: File;
};

export type BanChatMemberData = {
    chat_id: number | string;
    user_id: number;
    until_date?: number;
    revoke_messages?: boolean;
};

export type BanChatMemberResponse = Success & {
    result?: boolean;
};

export type UnbanChatMemberData = {
    chat_id: number | string;
    user_id: number;
    only_if_banned?: boolean;
};

export type UnbanChatMemberResponse = Success & {
    result?: boolean;
};

export type RestrictChatMemberData = {
    chat_id: number | string;
    user_id: number;
    permissions: ChatPermissions;
    use_independent_chat_permissions?: boolean;
    until_date?: number;
};

export type RestrictChatMemberResponse = Success & {
    result?: boolean;
};

export type PromoteChatMemberData = {
    chat_id: number | string;
    user_id: number;
    is_anonymous?: boolean;
    can_manage_chat?: boolean;
    can_delete_messages?: boolean;
    can_manage_video_chats?: boolean;
    can_restrict_members?: boolean;
    can_promote_members?: boolean;
    can_change_info?: boolean;
    can_invite_users?: boolean;
    can_post_stories?: boolean;
    can_edit_stories?: boolean;
    can_delete_stories?: boolean;
    can_post_messages?: boolean;
    can_edit_messages?: boolean;
    can_pin_messages?: boolean;
    can_manage_topics?: boolean;
};

export type PromoteChatMemberResponse = Success & {
    result?: boolean;
};

export type SetChatAdministratorCustomTitleData = {
    chat_id: number | string;
    user_id: number;
    custom_title: string;
};

export type SetChatAdministratorCustomTitleResponse = Success & {
    result?: boolean;
};

export type BanChatSenderChatData = {
    chat_id: number | string;
    sender_chat_id: number;
};

export type BanChatSenderChatResponse = Success & {
    result?: boolean;
};

export type UnbanChatSenderChatData = {
    chat_id: number | string;
    sender_chat_id: number;
};

export type UnbanChatSenderChatResponse = Success & {
    result?: boolean;
};

export type SetChatPermissionsData = {
    chat_id: number | string;
    permissions: ChatPermissions;
    use_independent_chat_permissions?: boolean;
};

export type SetChatPermissionsResponse = Success & {
    result?: boolean;
};

export type ExportChatInviteLinkData = {
    chat_id: number | string;
};

export type ExportChatInviteLinkResponse = Success & {
    result?: string;
};

export type CreateChatInviteLinkData = {
    chat_id: number | string;
    name?: string;
    expire_date?: number;
    member_limit?: number;
    creates_join_request?: boolean;
};

export type CreateChatInviteLinkResponse = Success & {
    result?: ChatInviteLink;
};

export type EditChatInviteLinkData = {
    chat_id: number | string;
    invite_link: string;
    name?: string;
    expire_date?: number;
    member_limit?: number;
    creates_join_request?: boolean;
};

export type EditChatInviteLinkResponse = Success & {
    result?: ChatInviteLink;
};

export type CreateChatSubscriptionInviteLinkData = {
    chat_id: number | string;
    name?: string;
    subscription_period: number;
    subscription_price: number;
};

export type CreateChatSubscriptionInviteLinkResponse = Success & {
    result?: ChatInviteLink;
};

export type EditChatSubscriptionInviteLinkData = {
    chat_id: number | string;
    invite_link: string;
    name?: string;
};

export type EditChatSubscriptionInviteLinkResponse = Success & {
    result?: ChatInviteLink;
};

export type RevokeChatInviteLinkData = {
    chat_id: number | string;
    invite_link: string;
};

export type RevokeChatInviteLinkResponse = Success & {
    result?: ChatInviteLink;
};

export type ApproveChatJoinRequestData = {
    chat_id: number | string;
    user_id: number;
};

export type ApproveChatJoinRequestResponse = Success & {
    result?: boolean;
};

export type DeclineChatJoinRequestData = {
    chat_id: number | string;
    user_id: number;
};

export type DeclineChatJoinRequestResponse = Success & {
    result?: boolean;
};

export type SetChatPhotoData = {
    chat_id: number | string;
    photo: InputFile;
};

export type SetChatPhotoResponse = Success & {
    result?: boolean;
};

export type DeleteChatPhotoData = {
    chat_id: number | string;
};

export type DeleteChatPhotoResponse = Success & {
    result?: boolean;
};

export type SetChatTitleData = {
    chat_id: number | string;
    title: string;
};

export type SetChatTitleResponse = Success & {
    result?: boolean;
};

export type SetChatDescriptionData = {
    chat_id: number | string;
    description?: string;
};

export type SetChatDescriptionResponse = Success & {
    result?: boolean;
};

export type PinChatMessageData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_id: number;
    disable_notification?: boolean;
};

export type PinChatMessageResponse = Success & {
    result?: boolean;
};

export type UnpinChatMessageData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_id?: number;
};

export type UnpinChatMessageResponse = Success & {
    result?: boolean;
};

export type UnpinAllChatMessagesData = {
    chat_id: number | string;
};

export type UnpinAllChatMessagesResponse = Success & {
    result?: boolean;
};

export type LeaveChatData = {
    chat_id: number | string;
};

export type LeaveChatResponse = Success & {
    result?: boolean;
};

export type GetChatData = {
    chat_id: number | string;
};

export type GetChatResponse = Success & {
    result?: ChatFullInfo;
};

export type GetChatAdministratorsData = {
    chat_id: number | string;
};

export type GetChatAdministratorsResponse = Success & {
    result?: Array<ChatMember>;
};

export type GetChatMemberCountData = {
    chat_id: number | string;
};

export type GetChatMemberCountResponse = Success & {
    result?: number;
};

export type GetChatMemberData = {
    chat_id: number | string;
    user_id: number;
};

export type GetChatMemberResponse = Success & {
    result?: ChatMember;
};

export type SetChatStickerSetData = {
    chat_id: number | string;
    sticker_set_name: string;
};

export type SetChatStickerSetResponse = Success & {
    result?: boolean;
};

export type DeleteChatStickerSetData = {
    chat_id: number | string;
};

export type DeleteChatStickerSetResponse = Success & {
    result?: boolean;
};

export type GetForumTopicIconStickersData = {
    [key: string]: unknown;
};

export type GetForumTopicIconStickersResponse = Success & {
    result?: Array<Sticker>;
};

export type CreateForumTopicData = {
    chat_id: number | string;
    name: string;
    icon_color?: number;
    icon_custom_emoji_id?: string;
};

export type CreateForumTopicResponse = Success & {
    result?: ForumTopic;
};

export type EditForumTopicData = {
    chat_id: number | string;
    message_thread_id: number;
    name?: string;
    icon_custom_emoji_id?: string;
};

export type EditForumTopicResponse = Success & {
    result?: boolean;
};

export type CloseForumTopicData = {
    chat_id: number | string;
    message_thread_id: number;
};

export type CloseForumTopicResponse = Success & {
    result?: boolean;
};

export type ReopenForumTopicData = {
    chat_id: number | string;
    message_thread_id: number;
};

export type ReopenForumTopicResponse = Success & {
    result?: boolean;
};

export type DeleteForumTopicData = {
    chat_id: number | string;
    message_thread_id: number;
};

export type DeleteForumTopicResponse = Success & {
    result?: boolean;
};

export type UnpinAllForumTopicMessagesData = {
    chat_id: number | string;
    message_thread_id: number;
};

export type UnpinAllForumTopicMessagesResponse = Success & {
    result?: boolean;
};

export type EditGeneralForumTopicData = {
    chat_id: number | string;
    name: string;
};

export type EditGeneralForumTopicResponse = Success & {
    result?: boolean;
};

export type CloseGeneralForumTopicData = {
    chat_id: number | string;
};

export type CloseGeneralForumTopicResponse = Success & {
    result?: boolean;
};

export type ReopenGeneralForumTopicData = {
    chat_id: number | string;
};

export type ReopenGeneralForumTopicResponse = Success & {
    result?: boolean;
};

export type HideGeneralForumTopicData = {
    chat_id: number | string;
};

export type HideGeneralForumTopicResponse = Success & {
    result?: boolean;
};

export type UnhideGeneralForumTopicData = {
    chat_id: number | string;
};

export type UnhideGeneralForumTopicResponse = Success & {
    result?: boolean;
};

export type UnpinAllGeneralForumTopicMessagesData = {
    chat_id: number | string;
};

export type UnpinAllGeneralForumTopicMessagesResponse = Success & {
    result?: boolean;
};

export type AnswerCallbackQueryData = {
    callback_query_id: string;
    text?: string;
    show_alert?: boolean;
    url?: string;
    cache_time?: number;
};

export type AnswerCallbackQueryResponse = Success & {
    result?: boolean;
};

export type GetUserChatBoostsData = {
    chat_id: number | string;
    user_id: number;
};

export type GetUserChatBoostsResponse = Success & {
    result?: UserChatBoosts;
};

export type GetBusinessConnectionData = {
    business_connection_id: string;
};

export type GetBusinessConnectionResponse = Success & {
    result?: BusinessConnection;
};

export type SetMyCommandsData = {
    commands: Array<BotCommand>;
    scope?: BotCommandScope;
    language_code?: string;
};

export type SetMyCommandsResponse = Success & {
    result?: boolean;
};

export type DeleteMyCommandsData = {
    scope?: BotCommandScope;
    language_code?: string;
};

export type DeleteMyCommandsResponse = Success & {
    result?: boolean;
};

export type GetMyCommandsData = {
    scope?: BotCommandScope;
    language_code?: string;
};

export type GetMyCommandsResponse = Success & {
    result?: Array<BotCommand>;
};

export type SetMyNameData = {
    name?: string;
    language_code?: string;
};

export type SetMyNameResponse = Success & {
    result?: boolean;
};

export type GetMyNameData = {
    language_code?: string;
};

export type GetMyNameResponse = Success & {
    result?: BotName;
};

export type SetMyDescriptionData = {
    description?: string;
    language_code?: string;
};

export type SetMyDescriptionResponse = Success & {
    result?: boolean;
};

export type GetMyDescriptionData = {
    language_code?: string;
};

export type GetMyDescriptionResponse = Success & {
    result?: BotDescription;
};

export type SetMyShortDescriptionData = {
    short_description?: string;
    language_code?: string;
};

export type SetMyShortDescriptionResponse = Success & {
    result?: boolean;
};

export type GetMyShortDescriptionData = {
    language_code?: string;
};

export type GetMyShortDescriptionResponse = Success & {
    result?: BotShortDescription;
};

export type SetChatMenuButtonData = {
    chat_id?: number;
    menu_button?: MenuButton;
};

export type SetChatMenuButtonResponse = Success & {
    result?: boolean;
};

export type GetChatMenuButtonData = {
    chat_id?: number;
};

export type GetChatMenuButtonResponse = Success & {
    result?: MenuButton;
};

export type SetMyDefaultAdministratorRightsData = {
    rights?: ChatAdministratorRights;
    for_channels?: boolean;
};

export type SetMyDefaultAdministratorRightsResponse = Success & {
    result?: boolean;
};

export type GetMyDefaultAdministratorRightsData = {
    for_channels?: boolean;
};

export type GetMyDefaultAdministratorRightsResponse = Success & {
    result?: ChatAdministratorRights;
};

export type EditMessageTextData = {
    business_connection_id?: string;
    chat_id?: number | string;
    message_id?: number;
    inline_message_id?: string;
    text: string;
    parse_mode?: string;
    entities?: Array<MessageEntity>;
    link_preview_options?: LinkPreviewOptions;
    reply_markup?: InlineKeyboardMarkup;
};

export type EditMessageTextResponse = Success & {
    result?: Message | boolean;
};

export type EditMessageCaptionData = {
    business_connection_id?: string;
    chat_id?: number | string;
    message_id?: number;
    inline_message_id?: string;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    show_caption_above_media?: boolean;
    reply_markup?: InlineKeyboardMarkup;
};

export type EditMessageCaptionResponse = Success & {
    result?: Message | boolean;
};

export type EditMessageMediaData = {
    business_connection_id?: string;
    chat_id?: number | string;
    message_id?: number;
    inline_message_id?: string;
    media: InputMedia;
    reply_markup?: InlineKeyboardMarkup;
};

export type EditMessageMediaResponse = Success & {
    result?: Message | boolean;
};

export type EditMessageLiveLocationData = {
    business_connection_id?: string;
    chat_id?: number | string;
    message_id?: number;
    inline_message_id?: string;
    latitude: number;
    longitude: number;
    live_period?: number;
    horizontal_accuracy?: number;
    heading?: number;
    proximity_alert_radius?: number;
    reply_markup?: InlineKeyboardMarkup;
};

export type EditMessageLiveLocationResponse = Success & {
    result?: Message | boolean;
};

export type StopMessageLiveLocationData = {
    business_connection_id?: string;
    chat_id?: number | string;
    message_id?: number;
    inline_message_id?: string;
    reply_markup?: InlineKeyboardMarkup;
};

export type StopMessageLiveLocationResponse = Success & {
    result?: Message | boolean;
};

export type EditMessageReplyMarkupData = {
    business_connection_id?: string;
    chat_id?: number | string;
    message_id?: number;
    inline_message_id?: string;
    reply_markup?: InlineKeyboardMarkup;
};

export type EditMessageReplyMarkupResponse = Success & {
    result?: Message | boolean;
};

export type StopPollData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_id: number;
    reply_markup?: InlineKeyboardMarkup;
};

export type StopPollResponse = Success & {
    result?: Poll;
};

export type DeleteMessageData = {
    chat_id: number | string;
    message_id: number;
};

export type DeleteMessageResponse = Success & {
    result?: boolean;
};

export type DeleteMessagesData = {
    chat_id: number | string;
    message_ids: Array<number>;
};

export type DeleteMessagesResponse = Success & {
    result?: boolean;
};

export type GetAvailableGiftsData = {
    [key: string]: unknown;
};

export type GetAvailableGiftsResponse = Success & {
    result?: Gifts;
};

export type SendGiftData = {
    user_id?: number;
    chat_id?: number | string;
    gift_id: string;
    pay_for_upgrade?: boolean;
    text?: string;
    text_parse_mode?: string;
    text_entities?: Array<MessageEntity>;
};

export type SendGiftResponse = Success & {
    result?: boolean;
};

export type GiftPremiumSubscriptionData = {
    user_id: number;
    month_count: number;
    star_count: number;
    text?: string;
    text_parse_mode?: string;
    text_entities?: Array<MessageEntity>;
};

export type GiftPremiumSubscriptionResponse = Success & {
    result?: boolean;
};

export type VerifyUserData = {
    user_id: number;
    custom_description?: string;
};

export type VerifyUserResponse = Success & {
    result?: boolean;
};

export type VerifyChatData = {
    chat_id: number | string;
    custom_description?: string;
};

export type VerifyChatResponse = Success & {
    result?: boolean;
};

export type RemoveUserVerificationData = {
    user_id: number;
};

export type RemoveUserVerificationResponse = Success & {
    result?: boolean;
};

export type RemoveChatVerificationData = {
    chat_id: number | string;
};

export type RemoveChatVerificationResponse = Success & {
    result?: boolean;
};

export type ReadBusinessMessageData = {
    business_connection_id: string;
    chat_id: number;
    message_id: number;
};

export type ReadBusinessMessageResponse = Success & {
    result?: boolean;
};

export type DeleteBusinessMessagesData = {
    business_connection_id: string;
    message_ids: Array<number>;
};

export type DeleteBusinessMessagesResponse = Success & {
    result?: boolean;
};

export type SetBusinessAccountNameData = {
    business_connection_id: string;
    first_name: string;
    last_name?: string;
};

export type SetBusinessAccountNameResponse = Success & {
    result?: boolean;
};

export type SetBusinessAccountUsernameData = {
    business_connection_id: string;
    username?: string;
};

export type SetBusinessAccountUsernameResponse = Success & {
    result?: boolean;
};

export type SetBusinessAccountBioData = {
    business_connection_id: string;
    bio?: string;
};

export type SetBusinessAccountBioResponse = Success & {
    result?: boolean;
};

export type SetBusinessAccountProfilePhotoData = {
    business_connection_id: string;
    photo: InputProfilePhoto;
    is_public?: boolean;
};

export type SetBusinessAccountProfilePhotoResponse = Success & {
    result?: boolean;
};

export type RemoveBusinessAccountProfilePhotoData = {
    business_connection_id: string;
    is_public?: boolean;
};

export type RemoveBusinessAccountProfilePhotoResponse = Success & {
    result?: boolean;
};

export type SetBusinessAccountGiftSettingsData = {
    business_connection_id: string;
    show_gift_button: boolean;
    accepted_gift_types: AcceptedGiftTypes;
};

export type SetBusinessAccountGiftSettingsResponse = Success & {
    result?: boolean;
};

export type GetBusinessAccountStarBalanceData = {
    business_connection_id: string;
};

export type GetBusinessAccountStarBalanceResponse = Success & {
    result?: StarAmount;
};

export type TransferBusinessAccountStarsData = {
    business_connection_id: string;
    star_count: number;
};

export type TransferBusinessAccountStarsResponse = Success & {
    result?: boolean;
};

export type GetBusinessAccountGiftsData = {
    business_connection_id: string;
    exclude_unsaved?: boolean;
    exclude_saved?: boolean;
    exclude_unlimited?: boolean;
    exclude_limited?: boolean;
    exclude_unique?: boolean;
    sort_by_price?: boolean;
    offset?: string;
    limit?: number;
};

export type GetBusinessAccountGiftsResponse = Success & {
    result?: OwnedGifts;
};

export type ConvertGiftToStarsData = {
    business_connection_id: string;
    owned_gift_id: string;
};

export type ConvertGiftToStarsResponse = Success & {
    result?: boolean;
};

export type UpgradeGiftData = {
    business_connection_id: string;
    owned_gift_id: string;
    keep_original_details?: boolean;
    star_count?: number;
};

export type UpgradeGiftResponse = Success & {
    result?: boolean;
};

export type TransferGiftData = {
    business_connection_id: string;
    owned_gift_id: string;
    new_owner_chat_id: number;
    star_count?: number;
};

export type TransferGiftResponse = Success & {
    result?: boolean;
};

export type PostStoryData = {
    business_connection_id: string;
    content: InputStoryContent;
    active_period: number;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    areas?: Array<StoryArea>;
    post_to_chat_page?: boolean;
    protect_content?: boolean;
};

export type PostStoryResponse = Success & {
    result?: Story;
};

export type EditStoryData = {
    business_connection_id: string;
    story_id: number;
    content: InputStoryContent;
    caption?: string;
    parse_mode?: string;
    caption_entities?: Array<MessageEntity>;
    areas?: Array<StoryArea>;
};

export type EditStoryResponse = Success & {
    result?: Story;
};

export type DeleteStoryData = {
    business_connection_id: string;
    story_id: number;
};

export type DeleteStoryResponse = Success & {
    result?: boolean;
};

export type SendStickerData = {
    business_connection_id?: string;
    chat_id: number | string;
    message_thread_id?: number;
    sticker: InputFile | string;
    emoji?: string;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
};

export type SendStickerResponse = Success & {
    result?: Message;
};

export type GetStickerSetData = {
    name: string;
};

export type GetStickerSetResponse = Success & {
    result?: StickerSet;
};

export type GetCustomEmojiStickersData = {
    custom_emoji_ids: Array<string>;
};

export type GetCustomEmojiStickersResponse = Success & {
    result?: Array<Sticker>;
};

export type UploadStickerFileData = {
    user_id: number;
    sticker: InputFile;
    sticker_format: string;
};

export type UploadStickerFileResponse = Success & {
    result?: File;
};

export type CreateNewStickerSetData = {
    user_id: number;
    name: string;
    title: string;
    stickers: Array<InputSticker>;
    sticker_type?: string;
    needs_repainting?: boolean;
};

export type CreateNewStickerSetResponse = Success & {
    result?: boolean;
};

export type AddStickerToSetData = {
    user_id: number;
    name: string;
    sticker: InputSticker;
};

export type AddStickerToSetResponse = Success & {
    result?: boolean;
};

export type SetStickerPositionInSetData = {
    sticker: string;
    position: number;
};

export type SetStickerPositionInSetResponse = Success & {
    result?: boolean;
};

export type DeleteStickerFromSetData = {
    sticker: string;
};

export type DeleteStickerFromSetResponse = Success & {
    result?: boolean;
};

export type ReplaceStickerInSetData = {
    user_id: number;
    name: string;
    old_sticker: string;
    sticker: InputSticker;
};

export type ReplaceStickerInSetResponse = Success & {
    result?: boolean;
};

export type SetStickerEmojiListData = {
    sticker: string;
    emoji_list: Array<string>;
};

export type SetStickerEmojiListResponse = Success & {
    result?: boolean;
};

export type SetStickerKeywordsData = {
    sticker: string;
    keywords?: Array<string>;
};

export type SetStickerKeywordsResponse = Success & {
    result?: boolean;
};

export type SetStickerMaskPositionData = {
    sticker: string;
    mask_position?: MaskPosition;
};

export type SetStickerMaskPositionResponse = Success & {
    result?: boolean;
};

export type SetStickerSetTitleData = {
    name: string;
    title: string;
};

export type SetStickerSetTitleResponse = Success & {
    result?: boolean;
};

export type SetStickerSetThumbnailData = {
    name: string;
    user_id: number;
    thumbnail?: InputFile | string;
    format: string;
};

export type SetStickerSetThumbnailResponse = Success & {
    result?: boolean;
};

export type SetCustomEmojiStickerSetThumbnailData = {
    name: string;
    custom_emoji_id?: string;
};

export type SetCustomEmojiStickerSetThumbnailResponse = Success & {
    result?: boolean;
};

export type DeleteStickerSetData = {
    name: string;
};

export type DeleteStickerSetResponse = Success & {
    result?: boolean;
};

export type AnswerInlineQueryData = {
    inline_query_id: string;
    results: Array<InlineQueryResult>;
    cache_time?: number;
    is_personal?: boolean;
    next_offset?: string;
    button?: InlineQueryResultsButton;
};

export type AnswerInlineQueryResponse = Success & {
    result?: boolean;
};

export type AnswerWebAppQueryData = {
    web_app_query_id: string;
    result: InlineQueryResult;
};

export type AnswerWebAppQueryResponse = Success & {
    result?: SentWebAppMessage;
};

export type SavePreparedInlineMessageData = {
    user_id: number;
    result: InlineQueryResult;
    allow_user_chats?: boolean;
    allow_bot_chats?: boolean;
    allow_group_chats?: boolean;
    allow_channel_chats?: boolean;
};

export type SavePreparedInlineMessageResponse = Success & {
    result?: PreparedInlineMessage;
};

export type SendInvoiceData = {
    chat_id: number | string;
    message_thread_id?: number;
    title: string;
    description: string;
    payload: string;
    provider_token?: string;
    currency: string;
    prices: Array<LabeledPrice>;
    max_tip_amount?: number;
    suggested_tip_amounts?: Array<number>;
    start_parameter?: string;
    provider_data?: string;
    photo_url?: string;
    photo_size?: number;
    photo_width?: number;
    photo_height?: number;
    need_name?: boolean;
    need_phone_number?: boolean;
    need_email?: boolean;
    need_shipping_address?: boolean;
    send_phone_number_to_provider?: boolean;
    send_email_to_provider?: boolean;
    is_flexible?: boolean;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup;
};

export type SendInvoiceResponse = Success & {
    result?: Message;
};

export type CreateInvoiceLinkData = {
    business_connection_id?: string;
    title: string;
    description: string;
    payload: string;
    provider_token?: string;
    currency: string;
    prices: Array<LabeledPrice>;
    subscription_period?: number;
    max_tip_amount?: number;
    suggested_tip_amounts?: Array<number>;
    provider_data?: string;
    photo_url?: string;
    photo_size?: number;
    photo_width?: number;
    photo_height?: number;
    need_name?: boolean;
    need_phone_number?: boolean;
    need_email?: boolean;
    need_shipping_address?: boolean;
    send_phone_number_to_provider?: boolean;
    send_email_to_provider?: boolean;
    is_flexible?: boolean;
};

export type CreateInvoiceLinkResponse = Success & {
    result?: string;
};

export type AnswerShippingQueryData = {
    shipping_query_id: string;
    ok: boolean;
    shipping_options?: Array<ShippingOption>;
    error_message?: string;
};

export type AnswerShippingQueryResponse = Success & {
    result?: boolean;
};

export type AnswerPreCheckoutQueryData = {
    pre_checkout_query_id: string;
    ok: boolean;
    error_message?: string;
};

export type AnswerPreCheckoutQueryResponse = Success & {
    result?: boolean;
};

export type GetStarTransactionsData = {
    offset?: number;
    limit?: number;
};

export type GetStarTransactionsResponse = Success & {
    result?: StarTransactions;
};

export type RefundStarPaymentData = {
    user_id: number;
    telegram_payment_charge_id: string;
};

export type RefundStarPaymentResponse = Success & {
    result?: boolean;
};

export type EditUserStarSubscriptionData = {
    user_id: number;
    telegram_payment_charge_id: string;
    is_canceled: boolean;
};

export type EditUserStarSubscriptionResponse = Success & {
    result?: boolean;
};

export type SetPassportDataErrorsData = {
    user_id: number;
    errors: Array<PassportElementError>;
};

export type SetPassportDataErrorsResponse = Success & {
    result?: boolean;
};

export type SendGameData = {
    business_connection_id?: string;
    chat_id: number;
    message_thread_id?: number;
    game_short_name: string;
    disable_notification?: boolean;
    protect_content?: boolean;
    allow_paid_broadcast?: boolean;
    message_effect_id?: string;
    reply_parameters?: ReplyParameters;
    reply_markup?: InlineKeyboardMarkup;
};

export type SendGameResponse = Success & {
    result?: Message;
};

export type SetGameScoreData = {
    user_id: number;
    score: number;
    force?: boolean;
    disable_edit_message?: boolean;
    chat_id?: number;
    message_id?: number;
    inline_message_id?: string;
};

export type SetGameScoreResponse = Success & {
    result?: Message | boolean;
};

export type GetGameHighScoresData = {
    user_id: number;
    chat_id?: number;
    message_id?: number;
    inline_message_id?: string;
};

export type GetGameHighScoresResponse = Success & {
    result?: Array<GameHighScore>;
};
