Post
A post is a text-based message, for a public or private audience. It can be a reply to other posts.
There's not a limit on the length of the text, but all Scuttlebot messages (including their headers) should be no longer than 8KiB (8192 bytes) for compatibility. However, due to a quirk in validation of some implementations, messages up to 8192 UTF-8 characters must be tolerated.
{
type: 'post',
text: String,
channel: String?,
root: MsgLink?,
branch: MsgLink? | MsgLinks?,
recps: FeedLinks?,
mentions: Links?
}
Text
text
is a markdown string that includes the body of the post.
See SSB-Markdown for some Scuttlebot-specific markdown rules.
Channel
channel
is optionally used for categorization.
It's similar to subreddits or chat channels.
Root and branch
root
and branch
are for replies.
root
should point to the topmost message in the thread.
branch
should point to the message or set of messages in the thread which is being replied to.
In the first reply of a thread, root === branch
, and both should be included.
root
and branch
should only point to type: post
messages.
If the post is about another message-type, use mentions
.
Mentions
mentions
is a generic reference to other feeds, entities, blobs, or channels/hashtags.
- User mentions: for when a user is referenced in the
text
. - Blob mentions: for when a file is referected in the
text
. - Message mentions: for when a message is referenced in the
text
. - Channel/hashtag mentions: for when a channel/hashtag is referenced in the
text
. Note: these are not returned in queries using thesbot.links
method, but they are in queries using thessb-backlinks
plugin.
A link in mentions
should be an object with property link
set to a feed id, blob id, message id or hashtag. Additional properties may also be set, such as name
for a name for the linked entity. For blob mentions, properties describing the file can be used, such as size
(size in bytes), and type
(mime-type).
Recps
recps
is a list of user-links specifying who the message is for.
This is typically used for encrypted messages, to specify who the message was encrypted for.
A link in recps
should be either a feed id or an object with property link
set to the feed id and optionally a name
field for a name associated with the feed.