osu-api-extended
Version:
Advanced osu! api wrapper for v1 and v2, with extra stuff
61 lines • 2.06 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.description = void 0;
const request_1 = require("../../../../utility/request");
const request = (0, request_1.namespace)('https://osu.ppy.sh/api/v2/');
exports.description = {
auth: 1,
title: __filename,
method: 'GET',
description: 'Posts a new comment to a comment thread',
params: [
{
name: 'comment',
params: [
{
type: 'string',
name: 'commentable_id',
optional: true,
description: 'Resource ID the comment thread is attached to',
},
{
type: 'string',
name: 'commentable_type',
optional: true,
description: '\`\`\`news_post\`\`\` or \`\`\`beatmapset\`\`\`',
},
{
type: 'string',
name: 'message',
optional: true,
description: 'Text of the comment',
},
{
type: 'string',
name: 'parent_id',
optional: true,
description: 'The id of the comment to reply to, null if not a reply',
},
],
}
],
return: 'response',
};
const name = async (object) => {
const obj = {};
if (object.commentable_id)
obj['comment[commentable_id]'] = object.commentable_id;
if (object.commentable_type)
obj['comment[commentable_type]'] = object.commentable_type;
if (object.message)
obj['comment[message]'] = object.message;
if (object.parent_id)
obj['comment[parent_id]'] = object.parent_id;
const data = await request(`comments`, {
method: 'POST',
params: obj,
});
return data;
};
exports.default = name;
//# sourceMappingURL=new.js.map
;