Class BaseComment

Represents a BaseComment on iFunny

Hierarchy

Constructors

Properties

#author: null | SimpleUser = null

The author of the comment

#client: Client<boolean>

Client instance attached to the Object

#content: Content

The content of the comment

#endpointUrl: string = Endpoints.account

Endpoint url the object will request to

#payload: APIComment

The payload of the object.

Accessors

  • get date(): Date
  • Returns the date when the comment was created.

    Returns

    The comment's date as a Date object.

    Returns Date

  • get endpointUrl(): string
  • Endpoint url for requests to update the payload

    Returns string

  • set endpointUrl(value: string): void
  • Parameters

    • value: string

    Returns void

  • get isEdited(): boolean
  • Whether the comment has been edited.

    Returns

    True if the comment has been edited, false otherwise.

    Returns boolean

  • get isReply(): boolean
  • Whether the comment is a reply to another comment.

    Returns

    True if the comment is a reply, false otherwise.

    Returns boolean

  • get isSmiled(): boolean
  • Whether the comment has been smiled by the user.

    Returns

    True if the comment has been smiled, false otherwise.

    Returns boolean

  • get isUnsmiled(): boolean
  • Whether the user has un-smiled the comment.

    Returns

    True if the comment has been un-smiled, false otherwise.

    Returns boolean

  • get payload(): Payload
  • Get the payload of the object

    Returns Payload

  • set payload(payload: Partial<Payload>): void
  • Updates the payload of the object.

    Returns

    The current instance

    Parameters

    • payload: Partial<Payload>

      The payload to merge into the current instance

    Returns void

  • get state(): null | "deleted" | "normal" | "top" | "abused" | "deleted_self"
  • The state of the comment.

    Returns

    The state of the comment, or null if the state is not available.

    Returns null | "deleted" | "normal" | "top" | "abused" | "deleted_self"

Methods

  • Gets the value from the payload from its key

    Returns

    Type Parameters

    • P extends APIComment

    • K extends string | number | symbol

    Parameters

    • key: K

      The key to get the value of

    Returns Nullify<P[K]>

Generated using TypeDoc