/**
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
* Copyright (C) 2023-2026 Roj
*
* This file is part of MTKruto.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
import type { MaybePromise } from "../1_utilities.js";
import type { DC } from "../3_transport.js";
import type { Birthday, BotCommandScope, ChatListItem, ChatMemberRights, FileSource, ID, InlineQueryResultButton, InputLinkPreview, LinkPreview, MessageEntity, MessageSearchFilter, MiniAppMode, ParseMode, Reaction, ReplyMarkup, ReplyTo, SelfDestructOption, StoryInteractiveArea, StoryPrivacy, WorkingHours } from "../3_types.js";
export interface InvokeParams {
dc?: DC;
type?: "download" | "upload";
}
export interface AnswerCallbackQueryParams {
/** A text to be shown to the user. */
text?: string;
/** Whether to show the text as an alert (popup). */
isAlert?: boolean;
/** A URL to be opened. */
url?: string;
/** TTL of answer caches in seconds. */
cacheTime?: number;
}
export interface SignInParamsUser {
/** A user phone number or a function that returns it. */
phone: S | (() => MaybePromise);
/** A verification code or a function that returns it. */
code: S | (() => MaybePromise);
/** An account password or a function that returns it. */
password: S | ((hint: string | null) => MaybePromise);
}
export interface SignInParamsBot {
/** A bot token. */
botToken: string;
}
export type SignInParams = SignInParamsUser | SignInParamsBot;
export interface _BusinessConnectionIdCommon {
/** The identifier of a business connection to perform the action on. Bot-only. */
businessConnectionId?: string;
}
export interface _ReplyMarkupCommon {
/** The reply markup of the message. Bot-only. */
replyMarkup?: ReplyMarkup;
}
export interface _PaidBroadcastCommon {
/** Whether the message is a broadcast that is going to be paid for. Bot-only. */
isPaidBroadcast?: boolean;
}
export interface _SendCommon extends _BusinessConnectionIdCommon, _PaidBroadcastCommon {
/** Whether to send the message in a silent way without making a sound on the recipients' clients. */
isSilent?: boolean;
/** Whether to protect the contents of the message from copying and forwarding. */
isContentProtected?: boolean;
/** Information on what the message is replying to. */
replyTo?: ReplyTo;
/** The identifier of a thread to send the message to. */
messageThreadId?: number;
/** The identifier of a chat to send the message on behalf of. User-only. */
sendAs?: ID;
/** The identifier of a message effect to be attached to the message. */
effectId?: number;
/** If specified, the message will be scheduled to be sent at that date. User-only. */
sendAt?: number;
}
export interface SendMessageParams extends _SendCommon, _ReplyMarkupCommon {
/** The parse mode to use. If omitted, the default parse mode will be used. */
parseMode?: ParseMode;
/** The message's entities. */
entities?: MessageEntity[];
/** The message's link preview. */
linkPreview?: InputLinkPreview;
}
export interface SendMessageDraftParams {
/** The identifier of a thread to send the message to. */
messageThreadId?: number;
/** The parse mode to use. If omitted, the default parse mode will be used. */
parseMode?: ParseMode;
/** The message's entities. */
entities?: MessageEntity[];
}
export interface SendChatActionParams extends _BusinessConnectionIdCommon {
messageThreadId?: number;
}
export interface _EditMessageTextCommon extends _ReplyMarkupCommon {
/** The parse mode to use. If omitted, the default parse mode will be used. */
parseMode?: ParseMode;
/** The message's entities. */
entities?: MessageEntity[];
/** The message's link preview. */
linkPreview?: LinkPreview;
}
export interface EditMessageTextParams extends _BusinessConnectionIdCommon, _EditMessageTextCommon {
}
export interface EditInlineMessageTextParams extends _EditMessageTextCommon {
}
export interface _EditMessageCaptionCommon extends _ReplyMarkupCommon {
/** The message's new caption. If omitted, the caption will be removed. */
caption?: string;
/** The parse mode to use. If omitted, the default parse mode will be used. */
parseMode?: ParseMode;
/** The caption's entities. */
entities?: MessageEntity[];
}
export interface EditMessageCaptionParams extends _BusinessConnectionIdCommon, _EditMessageCaptionCommon {
}
export interface EditInlineMessageCaptionParams extends _EditMessageCaptionCommon {
}
export interface EditMessageReplyMarkupParams extends _BusinessConnectionIdCommon, _ReplyMarkupCommon {
}
export interface EditMessageMediaParams extends _BusinessConnectionIdCommon, _ReplyMarkupCommon {
}
export interface EditInlineMessageMediaParams extends _ReplyMarkupCommon {
}
export interface ForwardMessagesParams extends Omit<_SendCommon, "replyToMessageId" | "replyMarkup"> {
/** Whether to not include the original sender of the message that is going to be forwarded. */
isSenderNameDropped?: boolean;
/** Whether to not include the original caption of the message that is going to be forwarded. */
isCaptionDropped?: boolean;
}
export interface SendPollParams extends _SendCommon, _ReplyMarkupCommon {
/** The entities of the poll's question. */
questionEntities?: MessageEntity[];
/** The parse mode to use for the poll's question. If omitted, the default parse mode will be used. */
questionParseMode?: ParseMode;
/** Whether the poll should be anonymous. */
isAnonymous?: boolean;
/** The type of the poll. */
type?: "quiz" | "regular";
/** Whether multiple selections should be allowed. Only valid for regular polls. */
isMultipleAnswersAllowed?: boolean;
/** Index of the correct option. Required for quiz polls. */
correctOptionIndexes?: number[];
/** A text that will be shown to the user when the poll is answered. Only valid for quiz polls. */
explanation?: string;
/** The parse mode to use for the explanation. if omitted, the default parse mode will be used. */
explanationParseMode?: ParseMode;
/** The explanation's entities. */
explanationEntities?: MessageEntity[];
/** An optional description. */
description?: string;
/** The parse mode to use for the poll's description. If omitted, the default parse mode will be used. */
descriptionParseMode?: ParseMode;
/** The entities of the poll's description. */
descriptionEntities?: MessageEntity[];
/** Duration of the poll in seconds. Must be in the range of 5-600. Cannot be used simultaneously with `closeDate`. */
openPeriod?: number;
/** The time when the poll will be closed. Must be at least 5 seconds in the future, and no more than 600. Cannot be used simultaneously with `openPeriod`. */
closeDate?: number;
/** Whether the poll should be closed as soon as it is sent, allowing no answers. */
isClosed?: boolean;
/** Whether revoting is allowed. */
isRevotingAllowed?: boolean;
/** Whether the list of options should be shuffled. */
isShuffled?: boolean;
/** Whether the result of the poll should be hidden until voting is closed. */
isResultHidden?: boolean;
/** Whether it is allowed for options to be added. Not supported for anonymous polls and quizzes. */
isAddingOptionsAllowed?: boolean;
/** The codes of the countries where the poll is available in. */
countries?: string[];
/** Whether only channel subscribers can vote in the poll. */
isSubscriberOnly?: boolean;
}
export interface SendChecklistParams extends _SendCommon {
/** The entities of the to-do list's title. */
titleEntities?: MessageEntity[];
/** The parse mode to use for the title. If omitted, the default parse mode will be used. */
titleParseMode?: ParseMode;
/** Whether users other than the creator of the to-do list can add more items. */
isExtendableByOthers?: boolean;
/** Whether users other than the creator of the to-do list can mark items as completed. */
isCompletableByOthers?: boolean;
}
export interface SendInvoiceParams extends _SendCommon, _ReplyMarkupCommon {
providerToken?: string;
maxTipAmount?: number;
suggestedTipAmounts?: number[];
startParameter?: string;
providerData?: string;
photoUrl?: string;
photoSize?: number;
photoWidth?: number;
photoHeight?: number;
needName?: boolean;
needPhoneNumber?: boolean;
needEmail?: boolean;
needShippingAddress?: boolean;
sendPhoneNumberToProvider?: boolean;
sendEmailToProvider?: boolean;
isFlexible?: boolean;
}
export interface DownloadChunkParams {
/** Size of the chunk to download in bytes. */
chunkSize?: number;
/** Download offset in bytes. */
offset?: number;
}
export interface DownloadParams {
/** Size of each download chunk in bytes. */
chunkSize?: number;
/** Download offset in bytes. */
offset?: number;
/** Download abort signal. */
signal?: AbortSignal;
}
export interface _UploadCommon {
/** The file name to assign if applicable. */
fileName?: string;
/** The file's size. */
fileSize?: number;
/** The mime type to assign if applicable. */
mimeType?: string;
/** Size of each upload chunk in bytes. */
chunkSize?: number;
/** Upload abort signal. */
signal?: AbortSignal;
/** A progress ID retrieved from the method getProgressId. If specified, updates on the upload progress will be sent. */
progressId?: string;
}
export interface AnswerInlineQueryParams {
/** TTL of the caches of the results in seconds. Defaults to 300. */
cacheTime?: number;
/** Whether the result caches should only be for the user who made the inline query. */
isPersonal?: boolean;
/** A parameter to be passed to the same query next time when the userβs client asks for more results. Canβt be longer than 64 bytes. */
nextOffset?: string;
isGallery?: boolean;
/** A button to be shown along with the results. */
button?: InlineQueryResultButton;
}
export interface SetMyCommandsParams {
/** A two-letter ISO 639-1 language code. If omitted, the command details will be updated for users having an unsupported language. */
languageCode?: string;
/** The scope in which the commands are available. */
scope?: BotCommandScope;
}
export type GetMyCommandsParams = SetMyCommandsParams;
export interface DeleteMessagesParams {
/** Whether to delete the messages only for this side. */
onlyForMe?: boolean;
}
export interface DeleteMessageParams {
/** Whether to delete the message only for this side. */
onlyForMe?: boolean;
}
export interface _CaptionCommon {
/** The caption to attach. */
caption?: string;
/** The caption's entities. */
captionEntities?: MessageEntity[];
/** The parse mode to use for the caption. if omitted, the default parse mode will be used. */
parseMode?: ParseMode;
}
export interface _SpoilCommon {
/** Whether to mark the media as a spoiler. */
hasSpoiler?: boolean;
}
export interface _StarCount {
/** The amount of stars that will be required to unlock the media. */
starCount?: number;
}
export interface SendPhotoParams extends _CaptionCommon, _SpoilCommon, _UploadCommon, _SendCommon, _ReplyMarkupCommon, _StarCount {
/** The photo's self-destruct preference. */
selfDestruct?: SelfDestructOption;
}
export interface SendLivePhotoParams extends _CaptionCommon, _SpoilCommon, _UploadCommon, _SendCommon, _ReplyMarkupCommon, _StarCount {
/** The live photo's self-destruct preference. */
selfDestruct?: SelfDestructOption;
}
export interface SetChatPhotoParams extends _UploadCommon {
}
export interface _ThumbnailCommon {
/** A thumbnail to assign. Cannot be a URL. */
thumbnail?: FileSource;
}
export interface SendDocumentParams extends _CaptionCommon, _ThumbnailCommon, _UploadCommon, _SendCommon {
}
export interface SendStickerParams extends _UploadCommon, _SendCommon {
/** Emoji to bind to the sticker. */
emoji?: string;
}
export interface SendVideoParams extends _CaptionCommon, _ThumbnailCommon, _SpoilCommon, _UploadCommon, _SendCommon, _StarCount {
/** The duration of the video in seconds. */
duration?: number;
/** The width of the photo in pixels. */
width?: number;
/** The height of the photo in pixels. */
height?: number;
/** Whether the video is suitable for streaming. */
supportsStreaming?: boolean;
/** The video's self-destruct preference. */
selfDestruct?: SelfDestructOption;
}
export interface SendAnimationParams extends _CaptionCommon, _ThumbnailCommon, _SpoilCommon, _UploadCommon, _SendCommon {
/** The duration of the animation in seconds. */
duration?: number;
/** The width of the animation file. */
width?: number;
/** The height of the animation file. */
height?: number;
}
export interface SendVoiceParams extends _CaptionCommon, _ThumbnailCommon, _UploadCommon, _SendCommon {
/** The duration of the voice message in seconds. */
duration?: number;
}
export interface SendAudioParams extends _CaptionCommon, _ThumbnailCommon, _UploadCommon, _SendCommon {
/** The duration of the audio file in seconds. */
duration?: number;
/** Names of the entities that are being featured in the audio. */
performer?: string;
/** The title of the audio. */
title?: string;
}
export interface SendVideoNoteParams extends _CaptionCommon, _ThumbnailCommon, _UploadCommon, _SendCommon {
/** The duration of the video note in seconds. */
duration?: number;
/** The video's width and height (diameter). */
length?: number;
}
export interface SendMediaGroupParams extends _SendCommon {
}
export interface SendLocationParams extends _SendCommon, _ReplyMarkupCommon {
/** The accuracy radius of the location in meters. Must be in the range of 0-1500. */
horizontalAccuracy?: number;
/** The duration for which the location can be updated, in seconds. Must be in the range of 80-864,000. */
livePeriod?: number;
/** The direction which the user is moving towards. Must be in the range of 1-350. */
heading?: number;
/** The maximum distance for proximity alerts on approaching another chat member in meters. Must be in the range 1-100,000. */
proximityAlertRadius?: number;
}
export interface SendVenueParams extends _SendCommon, _ReplyMarkupCommon {
/** Foursquare identifier of the venue. */
foursquareId?: string;
/** Foursquare type of the venue, if known. For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream". */
foursquareType?: string;
}
export interface SendContactParams extends _SendCommon, _ReplyMarkupCommon {
/** The contact's last name. */
lastName?: string;
/** Additional information in the vCard format. */
vcard?: string;
}
export interface SendDiceParams extends _SendCommon, _ReplyMarkupCommon {
/** The type of the dice. Can be π², π―, π, β½, π³, π°. Defaults to π². */
emoji?: "π²" | "π―" | "π" | "β½" | "π³" | "π°";
}
export interface ReplyParams {
/** Whether to quote the message being replied to. Enabled by default for non-private chats. */
isQuoted?: boolean;
}
export interface GetHistoryParams {
/** The identifier of a message. If specified, the chat history will be fetched from that message. */
offsetId?: number;
/** A point in time. If specified, the chat history will be fetched from that date. */
offsetDate?: number;
/** Additional offset. */
addOffset?: number;
/** The maximum number of results to return. Must be in the range of 1-100. Defaults to 100. */
limit?: number;
/** The identifier of a takeout session. */
takeoutId?: string;
}
export interface GetSavedMessagesParams {
/** The identifier of a message. If specified, the messages will be fetched from that message. */
offsetId?: number;
/** A point in time. If specified, the messages will be fetched from that date. */
offsetDate?: number;
/** Additional offset. */
addOffset?: number;
/** The maximum number of results to return. Must be in the range of 1-100. Defaults to 100. */
limit?: number;
}
export interface GetSavedChatsParams {
/** The identifier of a message. If specified, the list of chats will be fetched from that message. */
offsetId?: number;
/** A point in time. If specified, the list of chats will be fetched from that date. */
offsetDate?: number;
/** A chat ID. If specified, the list of chats will be fetched from that chat. */
offsetChatId?: ID;
/** Additional offset. */
addOffset?: number;
/** The maximum number of results to return. Must be in the range of 1-100. Defaults to 100. */
limit?: number;
/** Whether to exclude pinned chats. */
excludePinned?: boolean;
}
export interface SetReactionsParams {
/** Whether to make the new reactions more notable. */
isBig?: boolean;
/** Whether to add the reaction to recent reactions. */
addToRecents?: boolean;
}
export interface AddReactionParams {
/** Whether to make the new reaction more notable. */
isBig?: boolean;
/** Whether to add the reaction to recent reactions. */
addToRecents?: boolean;
}
export interface GetChatsParams {
/** The chat list to get the chats from. Defaults to main. */
from?: "main" | "archived";
/** The last chat to get chats after. */
after?: ChatListItem;
/** The maximum number of results to return. Must be in the range of 1-100. Defaults to 100. */
limit?: number;
}
export interface PinMessageParams extends _BusinessConnectionIdCommon {
/** Whether to pin the message for both sides. For private chats only. */
bothSides?: boolean;
/** Whether to silently pin the message. */
isSilent?: boolean;
}
export interface UnpinMessageParams extends _BusinessConnectionIdCommon {
}
export interface UnpinMessagesParams {
/** A topic ID. If provided, messages in that topic will be unpinned. */
topicId?: number;
}
export interface BanChatMemberParams {
/** A point in time in the future when the ban will be reverted. */
until?: number;
/** Whether to delete all of the user's messages. */
deleteMessages?: boolean;
}
export interface SetChatMemberRightsParams {
/** The member's new rights. All fields default to `true` if the chat's default member rights allow. This means that this method is the same as unbanChatMember if this parameter is not provided or all of its fields are `true`. */
rights?: ChatMemberRights;
/** A point in time in the future when the restriction will be reverted. */
until?: number;
}
export interface CreateStoryParams extends _CaptionCommon, _UploadCommon {
/** The story's interactive areas. */
interactiveAreas?: StoryInteractiveArea[];
/** The story's privacy settings. */
privacy?: StoryPrivacy;
/** The period during which the story will be active. */
activeFor?: number;
/** Whether to add the story to highlights. */
highlight?: boolean;
/** Whether to protect the contents of the story from copying and forwarding. */
isContentProtected?: boolean;
}
export interface SearchMessagesParams {
/** A chat ID. If specified, only the corresponding chat will be searched. */
chatId?: ID;
/** A search query. */
query?: string;
/** If specified, only messages sent by `from` are returned. */
from?: ID;
/** A search filter to apply. */
filter?: MessageSearchFilter;
/** A message identifier to start searching after. */
offset?: number;
/** Additional offset. */
addOffset?: number;
/** The identifier of a message thread to search in. */
threadId?: number;
/** The maximum number of results to return. Must be in the range of 1-100. Defaults to 100. */
limit?: number;
}
export interface CreateInviteLinkParams {
/** An optional title to be attached to the link that can only be seen by admins. */
title?: string;
/** A point in time in the future when the invite link will be invalidated. */
expireAt?: number;
/** The times the invite link can be used. Cannot be specified while `requireApproval` is `true`. */
limit?: number;
/** Whether an admin must explicitly approve join requests originating from this invite link. Cannot be `true` while `limit` is specified. */
isApprovalRequired?: boolean;
}
export interface GetCreatedInviteLinksParams {
/** The identifier of an admin. If specified, only invite links created by this admin will be returned. */
by?: ID;
/** The maximum number of results to return. Must be in the range 1-100. Defaults to 100. */
limit?: number;
/** Whether only revoked invite links must be returned. */
isRevoked?: boolean;
/** Only get the invite links created after a specific date. */
afterDate?: number;
/** Only get the invite links created after a specific invite link. */
afterInviteLink?: string;
}
export interface StopPollParams extends _BusinessConnectionIdCommon, _ReplyMarkupCommon {
}
export interface EditMessageLiveLocationParams extends _BusinessConnectionIdCommon, _ReplyMarkupCommon {
/** The accuracy radius of the location in meters. Must be in the range of 0-1500. */
horizontalAccuracy?: number;
/** The direction which the user is moving towards. Must be in the range of 1-350. */
heading?: number;
/** The maximum distance for proximity alerts on approaching another chat member in meters. Must be in the range 1-100,000. */
proximityAlertRadius?: number;
}
export interface SendInlineQueryParams {
/** The inline query's text. Defaults to empty string. */
query?: string;
/** Bot-provided pagination offset. */
offset?: string;
}
export interface StartVideoChatParams {
/** The video chat's title. */
title?: string;
/** Whether this is going to be a live stream. */
isLiveStream?: boolean;
}
export interface ScheduleVideoChatParams extends StartVideoChatParams {
}
export interface JoinVideoChatParams {
/** The identifier of a chat to join the video chat on behalf of. */
joinAs?: ID;
/** Invite hash. */
inviteHash?: string;
/** Whether to enable audio. Enabled by default. */
isAudioEnabled?: boolean;
/** Whether to enable video. Enabled by default. */
isVideoEnabled?: boolean;
}
export interface DownloadLiveStreamSegmentParams {
/** Video quality. */
quality?: "low" | "medium" | "high";
/** Download abort signal. */
signal?: AbortSignal;
}
export interface AnswerPreCheckoutQueryParams {
error?: string;
}
export interface ApproveJoinRequestsParams {
/** If specified, only join requests initiated from this invite link will be approved. */
inviteLink?: string;
}
export interface DeclineJoinRequestsParams {
/** If specified, only join requests initiated from this invite link will be declined. */
inviteLink?: string;
}
export interface AddChatMemberParams {
/** The number of current messages to make visible to the user that is about to be added. */
historyLimit?: number;
}
export interface GetChatMembersParams {
/** The number of results to skip. */
offset?: number;
/** The maximum number of results to return. */
limit?: number;
}
export interface CreateGroupParams {
/** Users to invite after creating the group. */
users?: ID[];
/** Time to live of the messages of the group that is to be created in seconds. */
messageTtl?: number;
}
export interface CreateSupergroupParams {
/** The description of the supergroup that is to be created. */
description?: string;
/** Whether a forum should be created. */
isForum?: boolean;
/** Time to live of the messages of the supergroup that is to be created in seconds. */
messageTtl?: number;
}
export interface CreateChannelParams {
/** The description of the channel that is to be created. */
description?: string;
/** Time to live of the messages of the channel that is to be created in seconds. */
messageTtl?: number;
}
export interface StartBotParams {
/** A deeplink to follow. */
deeplink?: string;
/** If specified, the bot will be started in that chat instead of its own private chat. */
chatId?: ID;
}
export interface SetEmojiStatusParams {
/** If specified, the emoji status will be unset on that date. */
until?: number;
}
export interface UpdateProfileParams {
/** New account first name. */
firstName?: string;
/** New account last name. */
lastName?: string;
/** New account bio. */
bio?: string;
}
export interface GetTranslationsParams {
/** The platform to get translations for. Defaults to the client's platform. */
platform?: string;
/** The language to get translations for. Defaults to the client's language. */
language?: string;
}
export interface GetCommonChatsParams {
/** The identifier of a chat. If specified, the list of common chats will be fetched from that chat. */
fromChatId?: ID;
/** The maximum number of results to return. Must be in the range of 1-100. Defaults to 100. */
limit?: number;
}
export interface GetClaimedGiftsParams {
/** The identifier of a gift collection. If provided, only gifts inside it will be fetched. */
collectionId?: number;
/** Whether to exclude hosted gifts. */
isHostedExcluded?: boolean;
/** Whether to exclude unupgradable gifts. */
isUnupgradableExcluded?: boolean;
/** Whether to exclude upgradable gifts. */
isUpgradableExcluded?: boolean;
/** Whether to sort gifts by value. */
isSortedByValue?: boolean;
/** Whether to exclude unique gifts. */
isUniqueExcluded?: boolean;
/** Whether to exclude unlimited gifts. */
isUnlimitedExcluded?: boolean;
/** Whether to exclude saved gifts. */
isSavedExcluded?: boolean;
/** Whether to exclude unsaved gifts. */
isUnsavedExcluded?: boolean;
/** Whether to get gifts with colors. */
isWithColors?: boolean;
/** An offset key returned by a previous result. */
offset?: string;
/** The maximum number of results to return. */
limit?: number;
}
export interface SendGiftParams {
/** A message to send along with the gift. */
message?: string;
/** The parse mode to use for the message. */
parseMode?: ParseMode;
/** The entities of the message. */
entities?: MessageEntity[];
/** If true, only the receiver of the gift will know the name of the sender. */
isPrivate?: boolean;
/** Whether the gift should be upgraded before sending it. */
upgrade?: boolean;
}
export interface EnableSignaturesParams {
/** Whether author profiles should be shown in posts. */
showAuthorProfile?: boolean;
}
export interface SetBirthdayParams {
/** New birthday. If not set, birthday will be removed. */
birthday?: Birthday;
}
export interface SetPersonalChannelParams {
/** New personal channel. If not set, personal channel will be removed. */
chatId?: ID;
}
export interface SetNameColorParams {
/** Identifier of a custom emoji to display in message reply headers. */
customEmojiId?: string;
}
export interface SetProfileColorParams {
/** Identifier of a custom emoji to display in the profile. */
customEmojiId?: string;
}
export interface SetLocationParams {
/** Written address of the business. If not set, address will be removed. */
address?: string;
/** Latitude of the business. */
latitude?: number;
/** Longitude of the business. */
longitude?: number;
}
export interface SetWorkingHoursParams {
/** The working hours of the business. If not set, working hours will be removed. */
workingHours?: WorkingHours;
}
export interface CreateTopicParams {
/** The color to use for the default topic icon. */
color?: number;
/** Identifier of a custom emoji to display as the icon of the topic. */
customEmojiId?: string;
/** The identifier of a chat to create the topic on behalf of. User-only. */
sendAs?: ID;
}
export interface EditTopicParams {
/** Identifier of a custom emoji to display as the icon of the topic. */
customEmojiId?: string;
}
export interface GetLinkPreviewParams {
/** The parse mode to use. If omitted, the default parse mode will be used. */
parseMode?: ParseMode;
/** The message's entities. */
entities?: MessageEntity[];
}
export interface GetJoinRequestsParams {
/** An invite link. If specified, only join requests from that invite link will be returned. */
inviteLink?: string;
/** A search query. If specified, only matching users will be returned. */
search?: string;
/** A point in time. If specified, results will be fetched from that date. */
fromDate?: number;
/** A user ID. If specified, results will be fetched from that user. */
fromUserId?: ID;
/** The maximum number of results to return. Must be in the range of 1-100. Defaults to 100. */
limit?: number;
}
export interface OpenMiniAppParams {
/** The mode to open the mini app in. Defaults to the default mode. */
mode?: MiniAppMode;
/** The URL of the mini app to open. */
url?: string;
/** The start parameter to pass to the mini app. */
startParameter?: string;
/** Theme parameters encoded in JSON. */
themeParameters?: string;
/** Whether messages relevant to the mini app session should be sent silently. */
isSilent?: boolean;
/** The identifier of a chat to send relevant messages on behalf of. */
sendAs?: ID;
/** Whether the mini app is being opened from the menu. */
isFromMenu?: boolean;
/** Information on a message to which relevant messages should be replied to. */
replyTo?: ReplyTo;
}
export interface GetMessageReactionsParams {
/** A reaction. If specified, only reactions of this type will be returned. */
reaction?: Reaction;
/** A value returned from the field nextOffset of the results. If specified, the retrieval will start from there. */
offset?: string;
/** The maximum number of results to return. Must be in the range of 1-100. Defaults to 100. */
limit?: number;
}
export interface PromoteChatMemberParams {
/** Whether the administrator's presence in the chat is hidden. */
isAnonymous?: boolean;
/** Whether the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and surpass slow mode. */
canManageChat?: boolean;
/** Whether the administrator can delete messages of other users. */
canDeleteMessages?: boolean;
/** Whether the administrator can manage video chats. */
canManageVideoChats?: boolean;
/** Whether the administrator can restrict, ban or unban chat members. */
canRestrictMembers?: boolean;
/** Whether the administrator can promote regular members to administrators. */
canPromoteMembers?: boolean;
/** Whether the administrator can change the name of the chat, its photo, description and some other settings. */
canChangeInfo?: boolean;
/** Whether the administrator can invite users to the chat. */
canInviteUsers?: boolean;
/** Whether the administrator can make posts in the channel. Only available for channels. */
canPostMessages?: boolean;
/** Whether the administrator can pin posts and edit posts they didn't send. Only available for channels. */
canEditMessages?: boolean;
/** Whether the administrator can pin messages. Only available for groups and supergroups. */
canPinMessages?: boolean;
/** Whether the administrator can manage topics. Only available for supergroups. */
canManageTopics?: boolean;
/** Whether the administrator can post stories. */
canPostStories?: boolean;
/** Whether the administrator can edit stories. */
canEditStories?: boolean;
/** Whether the administrator can delete stories. */
canDeleteStories?: boolean;
/** Whether the administrator can manage direct messages. */
canManageDirectMessages?: boolean;
/** Whether the administrator can manage member tags. */
canManageTags?: boolean;
/** The custom title of the administrator. */
title?: string;
}
export interface OpenChatParams {
/** TTL of update differences for unpolled chats in seconds. Defaults to a value specified by Telegram. */
timeout?: number;
}
export interface CheckUsernameParams {
/** The identifier of a supergroup or a channel. If specified, the username check will be made against it. */
chatId?: ID;
}
export interface SetChatMemberTagParams {
/** The member's new tag. If not set, the member tag will be removed. */
tag?: string;
}
export interface UpdateChecklistParams {
/** List of identifiers of items to check. */
itemsToCheck?: number[];
/** List of identifiers of items to uncheck. */
itemsToUncheck?: number[];
}
export interface ResolveUsernameParams {
/** Affiliate program referrer. */
referrer?: string;
}
export interface AddContactParams {
/** The contact's last name. */
lastName?: string;
/** Whether the phone number of the current account should be shared with the new contact. */
isPhoneNumberShared?: boolean;
/** The contact's phone number. */
phoneNumber?: string;
/** A note to attach to the contact. */
note?: string;
/** The note's entities. */
noteEntities?: MessageEntity[];
/** The parse mode to use for the note */
noteParseMode?: ParseMode;
}
export interface SetContactNoteParams {
/** A note to attach to the contact. */
note?: string;
/** The note's entities. */
noteEntities?: MessageEntity[];
/** The parse mode to use for the note */
noteParseMode?: ParseMode;
}
export interface GetStoriesInAlbumParams {
/** The number of results to skip. */
offset?: number;
/** The maximum number of results to return. */
limit?: number;
}
export interface GetBlockedUsersParams {
/** Whether to fetch users blocked from viewing stories. */
isBlockedFromViewingStories?: boolean;
/** The number of results to skip. */
offset?: number;
/** The maximum number of results to return. */
limit?: number;
}
export interface AddBotToAttachmentsMenuParams {
/** Whether the bot is allowed to write to the user. */
isWriteAllowed?: boolean;
}
export interface GetLeftChannelsParams {
/** The number of results to skip. */
offset?: number;
}
export interface StartTakeoutSessionParams {
/** Whether contacts will be exported in the takeout session. */
isExportingContacts?: boolean;
/** Whether messages from private chats will be exported in the takeout session. */
isExportingPrivateChats?: boolean;
/** Whether messages from group chats will be exported in the takeout session. */
isExportingGroupChats?: boolean;
/** Whether messages from supergroup chats will be exported in the takeout session. */
isExportingSupergroupChats?: boolean;
/** Whether messages from channel chats will be exported in the takeout session. */
isExportingChannelChats?: boolean;
/** Whether files will be exported in the takeout session. */
isExportingFiles?: boolean;
/** The maximum file size that will be exported. */
maxFileSize?: number;
}
export interface EndTakeoutSessionParams {
/** Whether the takeout failed. Defaults to false. */
isFailed?: boolean;
}
export interface SummarizeTextParams {
/** A language code. If specified, the message will be summarized into that language. */
languageCode?: string;
}
export interface UpdateProfilePhotoParams extends _UploadCommon {
/** The identifier of a bot managed by the current user. If specified, the profile photo of the bot will be updated. User-only. */
botId?: ID;
/** Whether the photo should be set as the fallback public profile photo. User-only. */
isPublic?: boolean;
}
export interface UpdateProfileVideoParams extends _UploadCommon {
/** The identifier of a bot managed by the current user. If specified, the profile video of the bot will be updated. User-only. */
botId?: ID;
/** Whether the video should be set as the fallback public profile photo. User-only. */
isPublic?: boolean;
/** The timestamp in seconds to use as thumbnail. */
thumbnailTimestamp?: number;
}
export interface RemoveProfilePhotoParams {
/** The identifier of a bot managed by the current user. If specified, the profile photo of the bot will be removed. User-only. */
botId?: ID;
}
export interface GetStarTransactionsParams {
/** Whether TON transactions should be returned. */
isTon?: boolean;
/** Whether only inbound transactions should be returned. */
isInbound?: boolean;
/** Whether only outbound transactions should be returned. */
isOutbound?: boolean;
/** Whether results should be sorted in an ascending order. */
isAscending?: boolean;
/** Whether only transactions related to a specific subscription be returned. */
subscriptionId?: string;
/** An offset key returned by a previous result. */
offset?: string;
/** The maximum number of results to return. */
limit?: number;
}
export interface GiftPremiumSubscriptionParams {
/** A text to attach to the gift. */
text?: string;
/** The parse mode to use. If omitted, the default parse mode will be used. */
parseMode?: ParseMode;
/** The text's entities. */
entities?: MessageEntity[];
}
export interface GetProfilePhotosParams {
/** The number of results to skip. */
offset?: number;
/** The maximum number of results to return. */
limit?: number;
}
export interface CreateStickerSetParams extends _UploadCommon {
/** Whether a mask sticker set should be created. */
isMask?: boolean;
/** Whether a custom emoji set should be created. */
isCustomEmoji?: boolean;
/** Whether the items of the sticker set should be adaptive. */
isAdaptive?: boolean;
/** An optional thumbnail to use for the sticker set. */
thumbnail?: FileSource;
/** The name of the software used to create the sticker set. */
software?: string;
/** The identifier of the owner of the sticker set. Required for bots. Bot-only. */
userId?: ID;
}
export interface AddStickerToStickerSetParams {
/** The identifier of the owner of the sticker set. Required for bots. Bot-only. */
userId?: ID;
}
export interface ReplaceStickerInStickerSetParams {
/** The identifier of the owner of the sticker set. Required for bots. Bot-only. */
userId?: ID;
}
export interface SetStickerSetThumbnailParams extends _UploadCommon {
/** The identifier of the owner of the sticker set. Required for bots. Bot-only. */
userId?: ID;
}
export interface SetManagedBotAccessSettingsParams {
/** The identifiers of the users with access when access is restricted. The owner of the bot will always have access. */
usersWithAccess: ID[];
}
export interface DeleteAccountParams {
/** The account's password. */
password?: string;
}
export interface TranslateTextParams {
/** The tone of the translation. */
tone?: string;
}
//# sourceMappingURL=0_params.d.ts.map