Module

x/grammy/types.deno.ts

The Telegram Bot Framework.
Go to Latest
interface InputFileProxy
import { type InputFileProxy } from "https://deno.land/x/grammy@v1.10.1/types.deno.ts";

Proxy Type that enables customization of InputFile by transforming all affected types.

Properties

Opts: [M in keyof InputFileProxy<F>["Telegram"]]: Params<M, F>[0] extends undefined ? { } : NonNullable<Params<M, F>[0]>

Utility type providing the argument type for the given method name or {} if the method does not take any parameters

Telegram: { kickChatMember: InputFileProxy<F>["Telegram"]["banChatMember"]; getChatMembersCount: InputFileProxy<F>["Telegram"]["getChatMemberCount"]; getUpdates(args?: { offset?: number; limit?: number; timeout?: number; allowed_updates?: readonly string[]; }): 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; 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; from_chat_id: number | string; disable_notification?: boolean; protect_content?: boolean; message_id: number; }): Message; copyMessage(args: { chat_id: number | string; 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; photo: F | string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; 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; audio: F | string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; duration?: number; performer?: string; title?: string; thumb?: 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; document: F | string; thumb?: 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; video: F | string; duration?: number; width?: number; height?: number; thumb?: F; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; 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; animation: F | string; duration?: number; width?: number; height?: number; thumb?: F; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; 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; 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; video_note: F | string; duration?: number; length?: number; thumb?: 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; media: ReadonlyArray<
| InputFileProxy<F>["InputMediaAudio"]
| InputFileProxy<F>["InputMediaDocument"]
| InputFileProxy<F>["InputMediaPhoto"]
| InputFileProxy<F>["InputMediaVideo"]
>; disable_notification?: boolean; protect_content?: boolean; reply_to_message_id?: number; allow_sending_without_reply?: boolean; }
): Array<>; sendLocation(args: { chat_id: number | string; 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; 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; 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; 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; 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"
; }
): 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; 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; }): 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; }): 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; 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; 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: InputFileProxy<F>["InputMedia"]; reply_markup?: InlineKeyboardMarkup; }): ; 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; 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; uploadStickerFile(args: { user_id: number; png_sticker: F; }): File; createNewStickerSet(args: { user_id: number; name: string; title: string; png_sticker?: F | string; tgs_sticker?: F; webm_sticker?: F; emojis: string; contains_masks?: boolean; mask_position?: MaskPosition; }): true; addStickerToSet(args: { user_id: number; name: string; png_sticker?: F | string; tgs_sticker?: F; webm_sticker?: F; emojis: string; mask_position?: MaskPosition; }): true; setStickerPositionInSet(args: { sticker: string; position: number; }): true; deleteStickerFromSet(args: { sticker: string; }): true; setStickerSetThumb(args: { name: string; user_id: number; thumb?: F | 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; 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; 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[]; }

Wrapper type to bundle all methods of the Telegram API

InputMedia:
| InputFileProxy<F>["InputMediaAnimation"]
| InputFileProxy<F>["InputMediaDocument"]
| InputFileProxy<F>["InputMediaAudio"]
| InputFileProxy<F>["InputMediaPhoto"]
| InputFileProxy<F>["InputMediaVideo"]

This object represents the content of a media message to be sent. It should be one of

  • InputMediaAnimation
  • InputMediaDocument
  • InputMediaAudio
  • InputMediaPhoto
  • InputMediaVideo
InputMediaPhoto: { type: "photo"; media: F | string; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; }

Represents a photo to be sent.

InputMediaVideo: { type: "video"; media: F | string; thumb?: F; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; width?: number; height?: number; duration?: number; supports_streaming?: boolean; }

Represents a video to be sent.

InputMediaAnimation: { type: "animation"; media: F | string; thumb?: F; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; width?: number; height?: number; duration?: number; }

Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.

InputMediaAudio: { type: "audio"; media: F | string; thumb?: F; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; duration?: number; performer?: string; title?: string; }

Represents an audio file to be treated as music to be sent.

InputMediaDocument: { type: "document"; media: F | string; thumb?: F; caption?: string; parse_mode?: ParseMode; caption_entities?: MessageEntity[]; disable_content_type_detection?: boolean; }

Represents a general file to be sent.

import InputFileProxy
import { InputFileProxy } from "https://deno.land/x/grammy@v1.10.1/types.deno.ts";