Class ForumTopic

Hierarchy (view full)

Constructors

  • Parameters

    • client: TelegramClient | BaseClient

      The client that instantiated this

    • threadId: string | number

      Unique identifier of the forum topic

    • chatId: string | number

      Unique identifier for this chat

    • data: ForumTopicEdited | ForumTopic

      Unique identifier for this

    Returns ForumTopic

Properties

chatId: string

Unique identifier for this chat

iconColor: null | number

Color of the topic icon in RGB format

iconEmojiId?: string

Unique identifier of the custom emoji shown as the topic icon

name: null | string

Name of the topic

threadId: string

Unique identifier of the forum topic

Accessors

Methods

  • Protected

    Creates a clone of the current instance

    Returns Base

    A clone of the current instance

  • Protected

    Patches the current instance with new data

    Parameters

    • data: Record<string, any>

      The data to patch the instance with

    Returns Record<string, any>

    The patched data

  • Protected

    Updates the current instance with new data and returns a clone of the updated instance

    Parameters

    • data: Record<string, any>

      The data to update the instance with

    Returns Base

    A clone of the updated instance

  • Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.

    Returns Promise<true>

    Returns True on success.

  • Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights.

    Returns Promise<true>

    Returns True on success.

  • Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic.

    Parameters

    • Optionaloptions: {
          customEmojiId?: string;
          name?: string;
      }

      Options for edited forum topic.

      • OptionalcustomEmojiId?: string

        New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept

      • Optionalname?: string

        New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept

    Returns Promise<true>

    Returns True on success.

  • Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.

    Returns Promise<true>

    Returns True on success.

  • Flatten an object. Any properties that are collections will get converted to an array of keys.

    Parameters

    • OptionalpropsRecursive: boolean

      Optional. If true, calls toJSON method on nested objects.

    • Rest...props: Record<string, string | boolean>[]

      Optional. Specific properties to include/exclude, or rename.

    Returns Record<string, any>

    Flattened object.

  • Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.

    Returns Promise<true>

    Returns True on success.

  • Returns the id instance Chat, User, ChatMember and other

    Returns null | string