Skip to content

v2.comments.list_v3

ck edited this page Oct 6, 2024 · 1 revision

async Retrieves a list of all comments by given parameters.

Usage example

const { auth, v2 } = require('osu-api-extended');

async function main() {
  try {
    const result = await v2.comments.list({
      type: 'news_post',
      id: 1430,
    });
    if (result.error != null) {
      console.log(result.error);
      return;
    };


    console.log(result);
  } catch (error) {
    console.log(error);
  };
};

main();
Parameter Type Description
params.type 'news_post' 'beatmapset'
params.id string;
params.parent_id string;
params.after_id string;
params.cursor?.id number
params.cursor?.created_at string
params.sort 'new' 'old'
addons.legacy_only? boolean
addons.apiVersion? '20240130' '99999999'
addons.authKey? string
addons.timeout_ms? number
addons.ignoreSessionRefresh? boolean

Response

export interface CommentsListResponse {
  comments: Comment[]
  has_more: boolean
  has_more_id: any
  included_comments: any[]
  pinned_comments: PinnedComment[]
  user_votes: any[]
  user_follow: boolean
  users: User[]
  sort: string
  cursor?: Cursor
  top_level_count: number
  total: number
  commentable_meta: CommentableMeum[]
}

export interface Comment {
  id: number
  parent_id?: number
  user_id: number
  pinned: boolean
  replies_count: number
  votes_count: number
  commentable_type: string
  commentable_id: number
  legacy_name: any
  created_at: string
  updated_at: string
  deleted_at?: string
  edited_at?: string
  edited_by_id?: number
  message?: string
  message_html?: string
}

export interface PinnedComment {
  id: number
  parent_id: any
  user_id: number
  pinned: boolean
  replies_count: number
  votes_count: number
  commentable_type: string
  commentable_id: number
  legacy_name: any
  created_at: string
  updated_at: string
  deleted_at: any
  edited_at: any
  edited_by_id: any
  message: string
  message_html: string
}

export interface User {
  avatar_url: string
  country_code: string
  default_group: string
  id: number
  is_active: boolean
  is_bot: boolean
  is_deleted: boolean
  is_online: boolean
  is_supporter: boolean
  last_visit?: string
  pm_friends_only: boolean
  profile_colour?: string
  username: string
}

export interface Cursor {
  created_at: string
  id: number
}

export interface CommentableMeum {
  current_user_attributes?: CurrentUserAttributes
  id?: number
  type?: string
  title: string
  url?: string
  owner_id: any
  owner_title: any
}

export interface CurrentUserAttributes {
  can_new_comment_reason: string
}

[v3.x.x] Documentation


[v2.x.x] Documentation

Clone this wiki locally