-
I'm a hobby developer who has a Twitter bot. You can find him here: @billsbeepboop.I'm planning on migrating the bot to Mastodon and wanted to use Masto, but had a quick question. For the Twitter bot, I'm using this NPM package: https://npmjs.com/package/twit-thread. I use the library as my tweets are often longer than 250 characters. Often they'll be longer than 500 characters, which would be the character limit in Mastodon. Any suggestion on how I could go about creating a thread using Masto. Any suggestions would be much appreciated. Thank you very much. 🙏🏽 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The number of letters you can use in a single post is depending on your instance's configuration, so you need to fetch the limitation first. You can see it via After splitting the text by the given limit, you need to create a thread. However, there is no concept like a thread in Mastodon API. Instead, you just have to create the first post, then the second post as a reply, then the third post as a reply... and so on. You can do that by Let me know if you need a more elaborate description or working code. |
Beta Was this translation helpful? Give feedback.
The number of letters you can use in a single post is depending on your instance's configuration, so you need to fetch the limitation first. You can see it via
configuration.statuses.maxCharacters
frommasto.v2.instance.fetch
.After splitting the text by the given limit, you need to create a thread. However, there is no concept like a thread in Mastodon API. Instead, you just have to create the first post, then the second post as a reply, then the third post as a reply... and so on. You can do that by
masto.v1.statuses.create
withinReplyToId
.Let me know if you need a more elaborate description or working code.