Class Comment

Represents a Comment 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 author(): null | SimpleUser
  • Author of the Comment

    Alias

    creator

    Example

    const author = comment.author; // SimpleUser
    const user = await author.user(); // Full User

    Returns null | SimpleUser

  • get creator(): null | SimpleUser
  • Author of the Comment

    Alias

    author

    Example

    const author = comment.author; // SimpleUser
    const user = await author.user(); // Full User

    Returns null | SimpleUser

  • 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 id(): string
  • The unique id of the object

    Returns string

  • 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 lastReply(): null | Comment
  • The last reply to the comment.

    Returns

    The last reply to the comment, or null if there are no replies.

    Returns null | Comment

  • 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

Generated using TypeDoc