Class: ThreadsHelper

ThreadsHelper()

A helper type for thread-related API endpoints.

Constructor

new ThreadsHelper()

Source:

Methods

(async) fetch(threadId) → {Thread}

Fetch information about a thread you own or collaborate on.
Parameters:
Name Type Description
threadId number The identifier of the thread.
Source:
Returns:
A raw data object.
Type
Thread

(async) list(sort) → {Array.<BasicThread>}

List a page of threads you own or collaborate on.
Parameters:
Name Type Description
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<BasicThread>

(async) listAll(sort) → {Array.<BasicThread>}

List all pages of threads you own or collaborate on.
Parameters:
Name Type Description
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<BasicThread>

(async) listReplies(threadId, sort) → {Array.<Reply>}

List a page of replies for a thread you own or collaborate on.
Parameters:
Name Type Description
threadId number The identifier of the thread.
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<Reply>

(async) listRepliesAll(threadId, sort) → {Array.<Reply>}

List all pages of replies for a thread you own or collaborate on.
Parameters:
Name Type Description
threadId number The identifier of the thread.
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<Reply>

(async) listRepliesUntil(threadId, shouldContinue, sort) → {Array.<Reply>}

List multiple pages of replies for a thread you own or collaborate on until a condition is no longer met.
Parameters:
Name Type Description
threadId number The identifier of the thread.
shouldContinue function A function which determines if further pages are requested.
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<Reply>

(async) listUntil(shouldContinue, sort) → {Array.<BasicThread>}

List multiple pages of threads you own or collaborate on until a condition is no longer met.
Parameters:
Name Type Description
shouldContinue function A function which determines if further pages are requested.
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<BasicThread>

(async) reply(threadId, message) → {number}

Reply to a thread you own or collaborate on.
Parameters:
Name Type Description
threadId number The identifier of the thread.
message string The content of the new reply.
Source:
Returns:
The identifier of the newly-created post.
Type
number