itd-api / CommentsResource
Interface: CommentsResource
Defined in: resources/comments.ts:23
Комментарии и ответы на них.
Доступна как itd.comments. Комментарии к посту живут в itd.posts: itd.posts.comments() и itd.posts.comment().
Extends
BaseResource
Methods
iterateReplies()
iterateReplies(commentId, params?): Paginator<Comment>;Defined in: resources/comments.ts:53
Перебирает ответы на комментарий.
Parameters
commentId
string
params?
RepliesParams = {}
Returns
like()
like(commentId, options?): Promise<LikeResult>;Defined in: resources/comments.ts:119
Ставит реакцию на комментарий.
Parameters
commentId
string
options?
RequestOptions = {}
Returns
Promise<LikeResult>
remove()
remove(commentId, options?): Promise<void>;Defined in: resources/comments.ts:101
Удаляет комментарий. Восстановить его можно через restore.
Parameters
commentId
string
options?
RequestOptions = {}
Returns
Promise<void>
replies()
replies(commentId, params?): Promise<Page<Comment>>;Defined in: resources/comments.ts:48
Загружает страницу ответов на комментарий.
Здесь пагинация постраничная, в отличие от комментариев к посту, где курсорная.
Parameters
commentId
string
params?
RepliesParams = {}
Returns
reply()
reply(
commentId,
input,
options?): Promise<Comment>;Defined in: resources/comments.ts:66
Отвечает на комментарий.
Parameters
commentId
string
input
string | CommentInput
options?
RequestOptions = {}
Returns
Promise<Comment>
Example
await itd.comments.reply(commentId, 'согласен');
await itd.comments.reply(commentId, (c) => c.content('и вот почему').replyTo(userId));restore()
restore(commentId, options?): Promise<Comment>;Defined in: resources/comments.ts:110
Восстанавливает удалённый комментарий.
Parameters
commentId
string
options?
RequestOptions = {}
Returns
Promise<Comment>
unlike()
unlike(commentId, options?): Promise<LikeResult>;Defined in: resources/comments.ts:128
Убирает реакцию с комментария.
Parameters
commentId
string
options?
RequestOptions = {}
Returns
Promise<LikeResult>
update()
update(
commentId,
content,
options?): Promise<Comment>;Defined in: resources/comments.ts:91
Редактирует текст комментария.
Parameters
commentId
string
content
string
options?
RequestOptions = {}
Returns
Promise<Comment>