Class VoteableControlsAbstract

The base controls for all content that you can vote on.

Hierarchy (view full)

Methods

  • Approve an item.

    Parameters

    • id: string

      The ID of the item to approve.

    Returns Promise<void>

    A promise that resolves when the item has been approved.

    Note

    This requires the authenticated user to be a moderator of the subreddit with the posts permission.

  • Block the author of an item.

    Parameters

    • id: string

      The ID of the item to block the author of.

    Returns Promise<void>

    A promise that resolves when the request is complete.

    Note

    Apparently this only works if the item is in modmail or the user's inbox, and if it's not the request silently succeeds anyway.

  • Delete an item.

    Parameters

    • id: string

      The ID of the item to delete.

    Returns Promise<void>

    A promise that resolves when the item has been deleted.

  • Disable inbox replies for an item.

    Parameters

    • id: string

      The id of the item.

    Returns Promise<void>

    A promise that resolves when replies have been disabled.

  • Cast a downvote.

    Parameters

    • id: string

      The ID of the item to downvote.

    Returns Promise<void>

    A promise that resolves when the vote has been cast.

  • Edit an item.

    Parameters

    • id: string

      The ID of the item to edit.

    • newText: string

      The new text to use.

    Returns Promise<void>

    A promise that resolves when the edit is complete.

  • Enable inbox replies for an item.

    Parameters

    • id: string

      The id of the item.

    Returns Promise<void>

    A promise that resolves when replies have been enabled.

  • Give Reddit gold to the author of an item.

    Parameters

    • id: string

      The ID of the item to gild.

    Returns Promise<void>

    A promise that resolves when the item has been gilded.

  • Ignore any future reports of an item.

    Parameters

    • id: string

      The ID of the item to ignore reports for.

    Returns Promise<void>

    A promise that resolves when the setting has been changed.

    Note

    This requires the authenticated user to be a moderator of the subreddit with the posts permission.

  • Remove an item, optionally marking it as spam.

    Parameters

    • id: string

      The ID of the item to remove.

    • spam: boolean = false

      Whether or not to mark this item as spam. Defaults to false.

    Returns Promise<void>

    A promise that resolves when the item has been removed.

    Note

    This requires the authenticated user to be a moderator of the subreddit with the posts permission.

  • Reply to an item.

    Parameters

    • id: string

      The ID of the item to reply to.

    • text: string

      The text content of the reply to post.

    Returns Promise<Comment>

    A promise that resolves to the comment reply.

  • Report an item to the mods.

    The report will be anonymous if you are not a mod of the subreddit. If you are a mod the report will be tied to your username.

    Parameters

    • id: string

      The ID of the item to report.

    • Optional reason: string

      The reason you are reporting the item.

    Returns Promise<void>

    A promise that resolves when the item has been reported.

  • Save an item.

    This will make the item show up at reddit.com/saved.

    Parameters

    • id: string

      The ID of the item to save.

    Returns Promise<void>

    a promise that resolves when the item has been saved.

  • Unignore any future reports of an item.

    Parameters

    • id: string

      The ID of the item to unignore reports for.

    Returns Promise<void>

    A promise that resolves when the setting has been changed.

    Note

    This requires the authenticated user to be a moderator of the subreddit with the posts permission.

  • Unsave an item.

    This will make the item no longer show up at reddit.com/saved.

    Parameters

    • id: string

      The ID of the item to unsave.

    Returns Promise<void>

    a promise that resolves when the item has been unsaved.

  • Remove your vote.

    Parameters

    • id: string

      The ID of the item to unvote.

    Returns Promise<void>

    A promise that resolves when the vote has been removed.

  • Cast an upvote.

    Parameters

    • id: string

      The ID of the item to upvote.

    Returns Promise<void>

    A promise that resolves when the vote has been cast.

Generated using TypeDoc