Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TelegramProfiler

Hierarchy

  • TelegramProfiler

Implements

Index

Constructors

Properties

Methods

  • fetchChatPhoto(chat: string | number | TelegramChat | TelegramChatSender, options?: { size?: "big" | "small" }): Promise<null | PhotoResponse>
  • Fetch the photo file of a chat

    Parameters

    • chat: string | number | TelegramChat | TelegramChatSender
    • Optional options: { size?: "big" | "small" }
      • Optional size?: "big" | "small"

    Returns Promise<null | PhotoResponse>

  • fetchUserPhoto(user: TelegramUser, options?: { minWidth?: number }): Promise<null | PhotoResponse>
  • Fetch the photo file of a user

    Parameters

    • user: TelegramUser
    • Optional options: { minWidth?: number }
      • Optional minWidth?: number

        If set, the minimum size above the value is chosen. Otherwise the smallest one

    Returns Promise<null | PhotoResponse>

  • getChatProfile(chat: string | number | TelegramChat | TelegramChatSender, options?: { avatarUrl?: string; fromApi?: boolean }): Promise<TelegramChatProfile>
  • Get profile of the chat. If chat details are not attached with the chat object (e.g. chat is retrieved from state), getChat API method is called to fetch chat data.

    Parameters

    • chat: string | number | TelegramChat | TelegramChatSender
    • options: { avatarUrl?: string; fromApi?: boolean } = {}
      • Optional avatarUrl?: string

        Provide the avatarUrl of the chat profile. You can use fetchChatPhoto method to fetch the file and serve it through an open URL.

      • Optional fromApi?: boolean

        Get chat data from API by force.

    Returns Promise<TelegramChatProfile>

Generated using TypeDoc