Skip to content

v2.forums.topic.new

cyperdark edited this page May 23, 2023 · 1 revision

Edit your topic and post from the forum

Authentication

const { auth } = require('osu-api-extended');
await auth.login_lazer(username, password);

Function

await v2.forums.topic.new(forum_id, object, poll)

Parameters

Parameter Type Description
forum_id number Forum id
object.title string Title of the topic
object.body string Body of the topic
poll.title string Title of the poll.
poll.options string[] Newline-separated list of voting options. BBCode is supported.
poll.hide_results boolean Hide results of the poll until voting period ends
poll.length_days number Number of days for voting period. 0 means the voting will never ends (default: 0). This parameter is required if hide_results option is enabled.
poll.max_options number This is the number of options each user may select when voting.
poll.vote_change boolean Enable this to allow user to change their votes (default: false).

Response

export interface response {
  topic: {
    created_at: string;
    deleted_at: string;
    first_post_id: number;
    forum_id: number;
    id: number;
    is_locked: boolean;
    last_post_id: number;
    post_count: number;
    title: string;
    type: string;
    updated_at: string;
    user_id: number;
    poll: string;
  };
  post: {
    created_at: string;
    deleted_at: string;
    edited_at: string;
    edited_by_id: string;
    forum_id: number;
    id: number;
    topic_id: number;
    user_id: number;
    body: {
      html: string;
      raw: string;
    };
  };
}

[v3.x.x] Documentation


[v2.x.x] Documentation

Clone this wiki locally