Create topic

The forum.createTopic method on a Client instance makes a POST request to the forums/topics endpoint and returns a forum topic and the post attached to it.

Warning: This endpoint is not tested, you may or may not run into unexpected behavior.

Parameters

ParameterTypeOptionalDescription
optionsCreateTopicOptions

options.body

ParameterTypeOptionalDescription
bodystringContent of the topic
forum_idnumberID of the forum to create the topic in
titlestringTitle of the topic
with_pollbooleanCreate a poll with the topic?
forum_topic_pollPoll details

options.body.forum_topic_poll

ParameterTypeOptionalDescription
optionsstringNewline-separated list of voting options. BBCode is supported
titlestringTitle of the poll
hide_resultsbooleanHide results (until voting period ends)? Defaults to false
length_daysnumberLength of the voting period in days. 0 means that the voting will never end. This parameter is required if hide_results option is enabled
max_optionsnumberMax. number of votes each user can cast
vote_changebooleanCan a user change their votes? Defaults to false

Returns

Promise<{
  topic: ForumTopic;
  post: ForumPost & {
    body: ForumPostBody;
  };
}>;

Types

Possible Exceptions

See the error handling documentation for more information.

  • invalid_json_syntax
  • network_error
  • unexpected_response

Notice that something is missing? Found a typo? Think something's incomplete? Or think that something can be explained better? Feel free to open a pull request or submit an issue on the library's Github repository .