Discussions Tools¶
The discussions_* tools work with a comment thread when the assistant already has its id, for example from huddo_get_comments. To read or post comments on an idea, a space or a wiki page by its URL, assistants use huddo_get_comments and huddo_comment instead.
All five tools are in the discussions tool group and need Huddo Discussions.
Comment threads show one level of replies: a reply to a reply is attached to the top-level comment.
discussions_get_thread¶
Reads a comment thread by its id, newest post first.
Read-only · Needs: Discussions
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
discussionId |
id | Yes | The thread's id | |
messages |
integer | No | 20 | 1 to 50. The number of newest posts to return |
offset |
integer | No | 0 | Newest posts to skip, to read older ones. Pass nextOffset from an earlier answer |
maxChars |
integer | No | 1,000 | 100 to 10,000. The most characters of each message |
totalChars |
integer | No | 20,000 | 1,000 to 60,000. The most characters returned in total |
Returns: the messages, each with its text as Markdown, author, time, reactions and up to the last 10 replies, and truncated and nextOffset when there are more.
Example: "Show me the rest of that comment thread."
discussions_reply¶
Replies in a comment thread, either as a new top-level comment or under an existing comment.
Write · Needs: Discussions
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
discussionId |
id | Yes | The thread's id | |
replyTo |
id | No | A message in the thread to reply under | |
body |
string | Yes | Markdown, 1 to 20,000 characters. Headings, images and tables become plain text | |
mentionUserIds |
array of user ids | No | None | Up to 20 people to mention and notify |
Returns: discussionId, messageId, parentMessageId (for a reply) and unresolvedMentions, any id that couldn't be mentioned.
Example: "Reply to Alex in that thread and say the fix is deployed."
discussions_edit_message¶
Replaces the text of a comment. Only the comment's author can edit it, and the old text is gone.
Overwrite · Needs: Discussions
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
messageId |
id | Yes | The comment to edit | |
body |
string | Yes | The new text: Markdown, 1 to 20,000 characters | |
mentionUserIds |
array of user ids | No | None | Up to 20 people to mention and notify |
Returns: messageId, edited and unresolvedMentions.
Example: "Fix the typo in my last comment on the release page."
discussions_delete_message¶
Permanently deletes a comment, together with every reply to it. Only the comment's author can delete it.
Delete · Needs: Discussions
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
messageId |
id | Yes | The comment to delete | |
discussionId |
id | Yes | The thread the comment is in. A comment that isn't in this thread is refused |
Returns: deleted, messageId, discussionId and repliesDeleted, the number of replies deleted with it.
Example: "Delete the comment I just posted on the onboarding idea."
discussions_set¶
Reacts to a thread or a comment, mutes a thread, or resolves a wiki comment thread. With on set to false, it undoes the action: removes the reaction, unmutes, or reopens.
Write · Needs: Discussions
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
action |
string | Yes | react, mute or resolve |
|
discussionId |
id | Yes | The thread's id | |
messageId |
id | No | react only: the comment to react to. Without it, the reaction goes on the whole thread |
|
emoji |
string | No | react only, and required for it: the emoji, up to 16 characters |
|
on |
boolean | No | true | false removes the reaction, unmutes or reopens |
mutestops the user's notifications for the thread.resolvecloses a comment thread on a wiki page. The person who started the thread, or the page's editors, can resolve it.
Returns: the action and its outcome: the reaction, muted or resolved.
Example: "Resolve the inline comment thread about the diagram, it's been fixed."