Class LockableControlsAbstract

The base controls for all content that can be locked.

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.

  • 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.

  • 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.

  • Lock an item, preventing non-moderators from being able to post replies.

    Parameters

    • id: string

      The ID of the item to lock.

    Returns Promise<void>

    A promise that resolves when the item has been locked.

  • 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.

  • 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.

  • Unlock an item, allowing non-moderators to post replies.

    Parameters

    • id: string

      The ID of the item to unlock.

    Returns Promise<void>

    A promise that resolves when the item has been unlocked.

  • 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.