Module

x/grammy/types.web.ts>ApiMethods

The Telegram Bot Framework.
Very Popular
Go to Latest
type alias ApiMethods
import { type ApiMethods } from "https://dotland.deno.dev/x/grammy@v1.15.2/types.web.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: { chat_id: number | string; message_thread_id?: number; text: string; parse_mode?: ParseMode; entities?: MessageEntity[]; disable_web_page_preview?: boolean; disable_notification?: boolean; protect_content?: boolean; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): 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; 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[]; disable_notification?: boolean; protect_content?: boolean; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): MessageId; sendPhoto(args: { chat_id: number | string; message_thread_id?: number; photo: F | string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; has_spoiler?: boolean; disable_notification?: boolean; protect_content?: boolean; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): Message.PhotoMessage; sendAudio(args: { 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; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): Message.AudioMessage; sendDocument(args: { 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; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): Message.DocumentMessage; sendVideo(args: { 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[]; has_spoiler?: boolean; supports_streaming?: boolean; disable_notification?: boolean; protect_content?: boolean; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): Message.VideoMessage; sendAnimation(args: { 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[]; has_spoiler?: boolean; disable_notification?: boolean; protect_content?: boolean; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): Message.AnimationMessage; sendVoice(args: { 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; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): Message.VoiceMessage; sendVideoNote(args: { chat_id: number | string; message_thread_id?: number; video_note: F | string; duration?: number; length?: number; thumbnail?: F; disable_notification?: boolean; protect_content?: boolean; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): Message.VideoNoteMessage; sendMediaGroup(args: { chat_id: number | string; message_thread_id?: number; media: ReadonlyArray<>; disable_notification?: boolean; protect_content?: boolean; reply_to_message_id?: number; allow_sending_without_reply?: boolean; }): Array<>; sendLocation(args: { 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; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): Message.LocationMessage; editMessageLiveLocation(args: { chat_id?: number | string; message_id?: number; inline_message_id?: string; latitude: number; longitude: number; horizontal_accuracy?: number; heading?: number; proximity_alert_radius?: number; reply_markup?: InlineKeyboardMarkup; }): (Update.Edited & Message.LocationMessage) | true; stopMessageLiveLocation(args: { chat_id?: number | string; message_id?: number; inline_message_id?: string; reply_markup?: InlineKeyboardMarkup; }): (Update.Edited & Message.LocationMessage) | true; sendVenue(args: { 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; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): Message.VenueMessage; sendContact(args: { 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; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): Message.ContactMessage; sendPoll(args: { chat_id: number | string; message_thread_id?: number; question: string; options: readonly string[]; 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; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): Message.PollMessage; sendDice(args: { chat_id: number | string; message_thread_id?: number; emoji?: string; disable_notification?: boolean; protect_content?: boolean; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): Message.DiceMessage; sendChatAction(args: { 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; 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_post_messages?: boolean; can_edit_messages?: 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_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; 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: { chat_id: number | string; message_id: number; disable_notification?: boolean; }): true; unpinChatMessage(args: { 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; }): ChatFromGetChat; 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; answerCallbackQuery(args: { callback_query_id: string; text?: string; show_alert?: boolean; url?: string; cache_time?: number; }): true; setMyCommands(args: { commands: readonly BotCommand[]; scope?: BotCommandScope; language_code?: string; }): true; deleteMyCommands(args: { scope?: BotCommandScope; language_code?: string; }): true; getMyCommands(args: { scope?: BotCommandScope; language_code?: string; }): BotCommand[]; setChatMenuButton(args: { chat_id?: number; menu_button?: MenuButton; }): true; getChatMenuButton(args: { chat_id?: number; }): MenuButton; setMyDescription(args: { description?: string; language_code?: string; }): true; getMyDescription(args: { language_code?: string; }): BotDescription; setMyShortDescription(args: { short_description?: string; language_code?: string; }): true; getMyShortDescription(args: { language_code?: string; }): BotShortDescription; setMyDefaultAdministratorRights(args: { rights?: ChatAdministratorRights; for_channels?: boolean; }): true; getMyDefaultAdministratorRights(args: { for_channels?: boolean; }): ChatAdministratorRights; editMessageText(args: { chat_id?: number | string; message_id?: number; inline_message_id?: string; text: string; parse_mode?: ParseMode; entities?: MessageEntity[]; disable_web_page_preview?: boolean; reply_markup?: InlineKeyboardMarkup; }): (Update.Edited & Message.TextMessage) | true; editMessageCaption(args: { chat_id?: number | string; message_id?: number; inline_message_id?: string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; reply_markup?: InlineKeyboardMarkup; }): (Update.Edited & Message.CaptionableMessage) | true; editMessageMedia(args: { chat_id?: number | string; message_id?: number; inline_message_id?: string; media: InputMedia<F>; reply_markup?: InlineKeyboardMarkup; }): (Update.Edited & Message) | true; editMessageReplyMarkup(args: { chat_id?: number | string; message_id?: number; inline_message_id?: string; reply_markup?: InlineKeyboardMarkup; }): (Update.Edited & Message) | true; stopPoll(args: { chat_id: number | string; message_id: number; reply_markup?: InlineKeyboardMarkup; }): Poll; deleteMessage(args: { chat_id: number | string; message_id: number; }): true; sendSticker(args: { chat_id: number | string; sticker: F | string; emoji?: string; disable_notification?: boolean; protect_content?: boolean; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: ; }): 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_format: "static" | "animated" | "video"; 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; 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; }): 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; switch_pm_text?: string; switch_pm_parameter?: string; }): 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; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: InlineKeyboardMarkup; }): 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; setPassportDataErrors(args: { user_id: number; errors: readonly PassportElementError[]; }): true; sendGame(args: { chat_id: number; message_thread_id?: number; game_short_name: string; disable_notification?: boolean; protect_content?: boolean; reply_to_message_id?: number; allow_sending_without_reply?: boolean; reply_markup?: InlineKeyboardMarkup; }): 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>