You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a bot that replies to existing statuses, filters and then reposts. I'm using status_reply to easily tag the original post author, but recently got an errormastodon.errors.MastodonAPIError: ('Mastodon API returned error', 422, 'Unprocessable Entity', 'Validation failed: Text character limit of 500 exceeded')
It would be great if there was a way to do this validation, or enforce a limit before sending to Mastodon.
Especially when using status_reply a lot of logic is encapsulated in that funciton before it posts, incluing untag and mentions, which are what cause the status to be over length (the original post was 493 characters so adding in the @mention pushes it over 500).
If anyone has a clever way to handle this that I'm missing please share!
The text was updated successfully, but these errors were encountered:
There currently isn’t a way and you‘re absolutely right - there should be. Would be good to implement a function to compute and check effective status length in terms of what counts into the limit to what extent, and maybe with an option to compare against instance reported max length.
On 5. Jan 2023, at 18:57, Alex Yule ***@***.***> wrote:
I'm working on a bot that replies to existing statuses, filters and then reposts. I'm using status_reply to easily tag the original post author, but recently got an error mastodon.errors.MastodonAPIError: ('Mastodon API returned error', 422, 'Unprocessable Entity', 'Validation failed: Text character limit of 500 exceeded')
It would be great if there was a way to do this validation, or enforce a limit before sending to Mastodon.
Especially when using status_reply a lot of logic is encapsulated in that funciton before it posts, incluing untag and mentions, which are what cause the status to be over length (the original post was 493 characters so adding in the @mention pushes it over 500).
If anyone has a clever way to handle this that I'm missing please share!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I'm working on a bot that replies to existing statuses, filters and then reposts. I'm using
status_reply
to easily tag the original post author, but recently got an errormastodon.errors.MastodonAPIError: ('Mastodon API returned error', 422, 'Unprocessable Entity', 'Validation failed: Text character limit of 500 exceeded')
It would be great if there was a way to do this validation, or enforce a limit before sending to Mastodon.
Especially when using
status_reply
a lot of logic is encapsulated in that funciton before it posts, incluinguntag
and mentions, which are what cause the status to be over length (the original post was 493 characters so adding in the @mention pushes it over 500).If anyone has a clever way to handle this that I'm missing please share!
The text was updated successfully, but these errors were encountered: