Module

x/grammy/types.deno.ts>ApiMethods

The Telegram Bot Framework.
Very Popular
Latest
type alias ApiMethods
import { type ApiMethods } from "https://dotland.deno.dev/x/grammy@v1.31.3/types.deno.ts";

Wrapper type to bundle all methods of the Telegram Bot API

definition: { kickChatMember: ApiMethods<F>["banChatMember"]; getChatMembersCount: ApiMethods<F>["getChatMemberCount"]; getUpdates(args?: { offset?: number; limit?: number; timeout?: number; allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>; }): Update[]; setWebhook(args: { url: string; certificate?: F; ip_address?: string; max_connections?: number; allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>; drop_pending_updates?: boolean; secret_token?: string; }): true; deleteWebhook(args?: { drop_pending_updates?: boolean; }): true; getWebhookInfo(): WebhookInfo; getMe(): UserFromGetMe; logOut(): true; close(): true; sendMessage(args: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; text: string; parse_mode?: ParseMode; entities?: MessageEntity[]; link_preview_options?: LinkPreviewOptions; disable_notification?: boolean; protect_content?: boolean; allow_paid_broadcast?: boolean; message_effect_id?: string; reply_parameters?: ReplyParameters; reply_markup?: ; reply_to_message_id?: number; }): Message.TextMessage; forwardMessage(args: { chat_id: number | string; message_thread_id?: number; from_chat_id: number | string; disable_notification?: boolean; protect_content?: boolean; message_id: number; }): Message; forwardMessages(args: { chat_id: number | string; message_thread_id?: number; from_chat_id: number | string; message_ids: number[]; disable_notification?: boolean; protect_content?: boolean; }): MessageId[]; copyMessage(args: { chat_id: number | string; message_thread_id?: number; from_chat_id: number | string; message_id: number; caption?: string; parse_mode?: string; caption_entities?: MessageEntity[]; show_caption_above_media?: boolean; disable_notification?: boolean; protect_content?: boolean; allow_paid_broadcast?: boolean; reply_parameters?: ReplyParameters; reply_markup?: ; reply_to_message_id?: number; }): MessageId; copyMessages(args: { chat_id: number | string; message_thread_id?: number; from_chat_id: number | string; message_ids: number[]; disable_notification?: boolean; protect_content?: boolean; remove_caption?: boolean; }): MessageId[]; sendPhoto(args: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; photo: F | string; caption?: string; parse_mode?: ParseMode; caption_entities?: 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?: ; reply_to_message_id?: number; }): Message.PhotoMessage; sendAudio(args: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; audio: F | string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; duration?: number; performer?: string; title?: string; thumbnail?: F; disable_notification?: boolean; protect_content?: boolean; allow_paid_broadcast?: boolean; message_effect_id?: string; reply_parameters?: ReplyParameters; reply_markup?: ; reply_to_message_id?: number; }): Message.AudioMessage; sendDocument(args: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; document: F | string; thumbnail?: F; caption?: string; parse_mode?: ParseMode; caption_entities?: 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?: ; reply_to_message_id?: number; }): Message.DocumentMessage; sendVideo(args: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; video: F | string; duration?: number; width?: number; height?: number; thumbnail?: F; caption?: string; parse_mode?: ParseMode; caption_entities?: 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?: ; reply_to_message_id?: number; }): Message.VideoMessage; sendAnimation(args: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; animation: F | string; duration?: number; width?: number; height?: number; thumbnail?: F; caption?: string; parse_mode?: ParseMode; caption_entities?: 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?: ; reply_to_message_id?: number; }): Message.AnimationMessage; sendVoice(args: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; voice: F | string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; duration?: number; disable_notification?: boolean; protect_content?: boolean; allow_paid_broadcast?: boolean; message_effect_id?: string; reply_parameters?: ReplyParameters; reply_markup?: ; reply_to_message_id?: number; }): Message.VoiceMessage; sendVideoNote(args: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; video_note: F | string; duration?: number; length?: number; thumbnail?: F; disable_notification?: boolean; protect_content?: boolean; allow_paid_broadcast?: boolean; message_effect_id?: string; reply_parameters?: ReplyParameters; reply_markup?: ; reply_to_message_id?: number; }): Message.VideoNoteMessage; sendMediaGroup(args: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; media: ReadonlyArray<>; disable_notification?: boolean; protect_content?: boolean; allow_paid_broadcast?: boolean; message_effect_id?: string; reply_parameters?: ReplyParameters; reply_to_message_id?: number; }): Array<>; sendLocation(args: { 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?: ; reply_to_message_id?: number; }): Message.LocationMessage; editMessageLiveLocation(args: { 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; }): (Update.Edited & Message.LocationMessage) | true; stopMessageLiveLocation(args: { business_connection_id?: string; chat_id?: number | string; message_id?: number; inline_message_id?: string; reply_markup?: InlineKeyboardMarkup; }): (Update.Edited & Message.LocationMessage) | true; sendPaidMedia(args: { business_connection_id?: string; chat_id: number | string; star_count: number; media: InputPaidMedia<F>[]; payload?: string; caption?: string; parse_mode?: string; caption_entities?: MessageEntity[]; show_caption_above_media?: boolean; disable_notification?: boolean; protect_content?: boolean; allow_paid_broadcast?: boolean; reply_parameters?: ReplyParameters; reply_markup?: ; }): Message.PaidMediaMessage; sendVenue(args: { 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?: ; reply_to_message_id?: number; }): Message.VenueMessage; sendContact(args: { 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?: ; reply_to_message_id?: number; }): Message.ContactMessage; sendPoll(args: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; question: string; question_parse_mode?: string; question_entities?: MessageEntity[]; options: InputPollOption[]; is_anonymous?: boolean; type?: "quiz" | "regular"; allows_multiple_answers?: boolean; correct_option_id?: number; explanation?: string; explanation_parse_mode?: ParseMode; explanation_entities?: 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?: ; reply_to_message_id?: number; }): Message.PollMessage; sendDice(args: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; emoji?:
| (string & Record<never, never>)
| "🎲"
| "🎯"
| "🏀"
| "⚽"
| "🎳"
| "🎰"
; disable_notification?: boolean; protect_content?: boolean; allow_paid_broadcast?: boolean; message_effect_id?: string; reply_parameters?: ReplyParameters; reply_markup?: ; reply_to_message_id?: number; }
): Message.DiceMessage; sendChatAction(args: { business_connection_id?: string; chat_id: number | string; action:
| "typing"
| "upload_photo"
| "record_video"
| "upload_video"
| "record_voice"
| "upload_voice"
| "upload_document"
| "choose_sticker"
| "find_location"
| "record_video_note"
| "upload_video_note"
; message_thread_id?: number; }
): true; setMessageReaction(args: { chat_id: number | string; message_id: number; reaction?: ReactionType[]; is_big?: boolean; }): true; getUserProfilePhotos(args: { user_id: number; offset?: number; limit?: number; }): UserProfilePhotos; getFile(args: { file_id: string; }): File; banChatMember(args: { chat_id: number | string; user_id: number; until_date?: number; revoke_messages?: boolean; }): true; unbanChatMember(args: { chat_id: number | string; user_id: number; only_if_banned?: boolean; }): true; restrictChatMember(args: { chat_id: number | string; user_id: number; permissions: ChatPermissions; use_independent_chat_permissions?: boolean; until_date?: number; }): true; promoteChatMember(args: { 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; }): true; setChatAdministratorCustomTitle(args: { chat_id: number | string; user_id: number; custom_title: string; }): true; banChatSenderChat(args: { chat_id: number | string; sender_chat_id: number; }): true; unbanChatSenderChat(args: { chat_id: number | string; sender_chat_id: number; }): true; setChatPermissions(args: { chat_id: number | string; permissions: ChatPermissions; use_independent_chat_permissions?: boolean; }): true; exportChatInviteLink(args: { chat_id: number | string; }): string; createChatInviteLink(args: { chat_id: number | string; name?: string; expire_date?: number; member_limit?: number; creates_join_request?: boolean; }): ChatInviteLink; editChatInviteLink(args: { chat_id: number | string; invite_link: string; name?: string; expire_date?: number; member_limit?: number; creates_join_request?: boolean; }): ChatInviteLink; createChatSubscriptionInviteLink(args: { chat_id: number | string; name?: string; subscription_period: number; subscription_price: number; }): ChatInviteLink; editChatSubscriptionInviteLink(args: { chat_id: number | string; invite_link: string; name?: string; }): ChatInviteLink; revokeChatInviteLink(args: { chat_id: number | string; invite_link: string; }): ChatInviteLink; approveChatJoinRequest(args: { chat_id: number | string; user_id: number; }): true; declineChatJoinRequest(args: { chat_id: number | string; user_id: number; }): true; setChatPhoto(args: { chat_id: number | string; photo: F; }): true; deleteChatPhoto(args: { chat_id: number | string; }): true; setChatTitle(args: { chat_id: number | string; title: string; }): true; setChatDescription(args: { chat_id: number | string; description?: string; }): true; pinChatMessage(args: { business_connection_id?: string; chat_id: number | string; message_id: number; disable_notification?: boolean; }): true; unpinChatMessage(args: { business_connection_id?: string; chat_id: number | string; message_id?: number; }): true; unpinAllChatMessages(args: { chat_id: number | string; }): true; leaveChat(args: { chat_id: number | string; }): true; getChat(args: { chat_id: number | string; }): ChatFullInfo; getChatAdministrators(args: { chat_id: number | string; }): Array<ChatMemberOwner | ChatMemberAdministrator>; getChatMemberCount(args: { chat_id: number | string; }): number; getChatMember(args: { chat_id: number | string; user_id: number; }): ChatMember; setChatStickerSet(args: { chat_id: number | string; sticker_set_name: string; }): true; deleteChatStickerSet(args: { chat_id: number | string; }): true; getForumTopicIconStickers(): Sticker[]; createForumTopic(args: { chat_id: number | string; name: string; icon_color?:
| 7322096
| 16766590
| 13338331
| 9367192
| 16749490
| 16478047
; icon_custom_emoji_id?: string; }
): ForumTopic; editForumTopic(args: { chat_id: number | string; message_thread_id: number; name?: string; icon_custom_emoji_id?: string; }): true; closeForumTopic(args: { chat_id: number | string; message_thread_id: number; }): true; reopenForumTopic(args: { chat_id: number | string; message_thread_id: number; }): true; deleteForumTopic(args: { chat_id: number | string; message_thread_id: number; }): true; unpinAllForumTopicMessages(args: { chat_id: number | string; message_thread_id: number; }): true; editGeneralForumTopic(args: { chat_id: number | string; name: string; }): true; closeGeneralForumTopic(args: { chat_id: number | string; }): true; reopenGeneralForumTopic(args: { chat_id: number | string; }): true; hideGeneralForumTopic(args: { chat_id: number | string; }): true; unhideGeneralForumTopic(args: { chat_id: number | string; }): true; unpinAllGeneralForumTopicMessages(args: { chat_id: number | string; }): true; answerCallbackQuery(args: { callback_query_id: string; text?: string; show_alert?: boolean; url?: string; cache_time?: number; }): true; getUserChatBoosts(args: { chat_id: number | string; user_id: number; }): UserChatBoosts; getBusinessConnection(args: { business_connection_id: string; }): BusinessConnection; setMyCommands(args: { commands: readonly BotCommand[]; scope?: BotCommandScope; language_code?: LanguageCode; }): true; deleteMyCommands(args: { scope?: BotCommandScope; language_code?: LanguageCode; }): true; getMyCommands(args: { scope?: BotCommandScope; language_code?: LanguageCode; }): BotCommand[]; setMyName(args: { name?: string; language_code?: LanguageCode; }): true; getMyName(args: { language_code?: LanguageCode; }): BotName; setMyDescription(args: { description?: string; language_code?: LanguageCode; }): true; getMyDescription(args: { language_code?: LanguageCode; }): BotDescription; setMyShortDescription(args: { short_description?: string; language_code?: LanguageCode; }): true; getMyShortDescription(args: { language_code?: LanguageCode; }): BotShortDescription; setChatMenuButton(args: { chat_id?: number; menu_button?: MenuButton; }): true; getChatMenuButton(args: { chat_id?: number; }): MenuButton; setMyDefaultAdministratorRights(args: { rights?: ChatAdministratorRights; for_channels?: boolean; }): true; getMyDefaultAdministratorRights(args: { for_channels?: boolean; }): ChatAdministratorRights; editMessageText(args: { business_connection_id?: string; chat_id?: number | string; message_id?: number; inline_message_id?: string; text: string; parse_mode?: ParseMode; entities?: MessageEntity[]; link_preview_options?: LinkPreviewOptions; reply_markup?: InlineKeyboardMarkup; }): (Update.Edited & Message.TextMessage) | true; editMessageCaption(args: { business_connection_id?: string; chat_id?: number | string; message_id?: number; inline_message_id?: string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; show_caption_above_media?: boolean; reply_markup?: InlineKeyboardMarkup; }): (Update.Edited & Message.CaptionableMessage) | true; editMessageMedia(args: { business_connection_id?: string; chat_id?: number | string; message_id?: number; inline_message_id?: string; media: InputMedia<F>; reply_markup?: InlineKeyboardMarkup; }): (Update.Edited & Message) | true; editMessageReplyMarkup(args: { business_connection_id?: string; chat_id?: number | string; message_id?: number; inline_message_id?: string; reply_markup?: InlineKeyboardMarkup; }): (Update.Edited & Message) | true; stopPoll(args: { business_connection_id?: string; chat_id: number | string; message_id: number; reply_markup?: InlineKeyboardMarkup; }): Poll; deleteMessage(args: { chat_id: number | string; message_id: number; }): true; deleteMessages(args: { chat_id: number | string; message_ids: number[]; }): true; sendSticker(args: { business_connection_id?: string; chat_id: number | string; message_thread_id?: number; sticker: F | string; emoji?: string; disable_notification?: boolean; protect_content?: boolean; allow_paid_broadcast?: boolean; message_effect_id?: string; reply_parameters?: ReplyParameters; reply_markup?: ; reply_to_message_id?: number; }): Message.StickerMessage; getStickerSet(args: { name: string; }): StickerSet; getCustomEmojiStickers(args: { custom_emoji_ids: string[]; }): Sticker[]; uploadStickerFile(args: { user_id: number; sticker_format: "static" | "animated" | "video"; sticker: F; }): File; createNewStickerSet(args: { user_id: number; name: string; title: string; stickers: InputSticker<F>[]; sticker_type?: "regular" | "mask" | "custom_emoji"; needs_repainting?: boolean; }): true; addStickerToSet(args: { user_id: number; name: string; sticker: InputSticker<F>; }): true; setStickerPositionInSet(args: { sticker: string; position: number; }): true; deleteStickerFromSet(args: { sticker: string; }): true; replaceStickerInSet(args: { user_id: number; name: string; old_sticker: string; sticker: InputSticker<F>; }): true; setStickerEmojiList(args: { sticker: string; emoji_list: string[]; }): true; setStickerKeywords(args: { sticker: string; keywords?: string[]; }): true; setStickerMaskPosition(args: { sticker: string; mask_position?: MaskPosition; }): true; setStickerSetTitle(args: { name: string; title: string; }): true; deleteStickerSet(args: { name: string; }): true; setStickerSetThumbnail(args: { name: string; user_id: number; thumbnail?: F | string; format: "static" | "animated" | "video"; }): true; setCustomEmojiStickerSetThumbnail(args: { name: string; custom_emoji_id?: string; }): true; answerInlineQuery(args: { inline_query_id: string; results: readonly InlineQueryResult[]; cache_time?: number; is_personal?: boolean; next_offset?: string; button?: InlineQueryResultsButton; }): true; answerWebAppQuery(args: { web_app_query_id: string; result: InlineQueryResult; }): SentWebAppMessage; sendInvoice(args: { chat_id: number | string; message_thread_id?: number; title: string; description: string; payload: string; provider_token?: string; currency: string; prices: readonly LabeledPrice[]; max_tip_amount?: number; suggested_tip_amounts?: 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; reply_to_message_id?: number; }): Message.InvoiceMessage; createInvoiceLink(args: { title: string; description: string; payload: string; provider_token?: string; currency: string; prices: LabeledPrice[]; max_tip_amount?: number; suggested_tip_amounts?: 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; }): string; answerShippingQuery(args: { shipping_query_id: string; ok: boolean; shipping_options?: readonly ShippingOption[]; error_message?: string; }): true; answerPreCheckoutQuery(args: { pre_checkout_query_id: string; ok: boolean; error_message?: string; }): true; getStarTransactions(args: { offset?: number; limit?: number; }): StarTransactions; refundStarPayment(args: { user_id: number; telegram_payment_charge_id: string; }): true; setPassportDataErrors(args: { user_id: number; errors: readonly PassportElementError[]; }): true; sendGame(args: { 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; reply_to_message_id?: number; }): Message.GameMessage; setGameScore(args: { user_id: number; score: number; force?: boolean; disable_edit_message?: boolean; chat_id?: number; message_id?: number; inline_message_id?: string; }): (Update.Edited & Message.GameMessage) | true; getGameHighScores(args: { user_id: number; chat_id?: number; message_id?: number; inline_message_id?: string; }): GameHighScore[]; }
definition: ApiMethodsF<InputFile>