Get comments
The comments.getComments
method on a Client
instance makes a GET
request to the comments
endpoint and returns an object containing comments, users and other related data.
Example
const commentBundle = await api.comments.getComments({
query: {
commentable: {
id: 742961,
type: 'beatmapset'
}
}
});
Parameters
Parameter | Type | Optional | Description |
---|---|---|---|
options | GetCommentsOptions | ✓ |
options.query
Parameter | Type | Optional | Description |
---|---|---|---|
parent_id | number | ✓ | Get replies of a specific comment ID |
sort | CommentSort | ✓ | Sort by |
commentable | ✓ | Resource to get comments for | |
commentable.type | CommentableType | ✓ | Type of the resource |
commentable.id | number | ✓ | ID of the resource |
Returns
Promise<CommentBundle>;
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 .