Support other options besides "message" for posting to Mastodon

There are a bunch of options in the Mastodon API (and supported by Mastodon.py) for posting to Mastodon, but currently the HomeAssistant integration only allows specification of the message text. It would be great if we could have access to set these other variables when we post to Mastodon. Many other notification providers allow the caller to set other properties in the “data” sub-object.

I would like to propose the following additional properties:

  • sensitive: bool, defaulting to False. Specifies whether the body of the post should be hidden.
  • spoiler_text: string, defaulting to None. Only relevant when sensitive is set to True. Specifies the text that appears above the hidden content.
  • visibility: string, defaulting to None. If unset, it means that it will use the user’s default setting. otherwise it must be one of the following:
    • direct (post will be visible only to mentioned users)
    • private (post will be visible only to followers)
    • unlisted (post will be public but not appear on the public timeline)
    • public (post will be public)
  • idempotency_key: string, setting this to some unique value allows retries without danger of the toot being posted more than once.
  • language: string, specify to override automatic language detection. Accepts all valid ISO 639-1 (2-letter) or for languages where that do not have one, ISO 639-3 (three letter) language codes.

Thank you, Steve !
I was going to make this request also when I saw your contribution.

I would like also to send direct or private messages.

Turns out somebody else (They’re probably on here too, but I don’t know their handle) had the same thought as me at the same time that I did – only they did something about it. Go and support these two PRs (functionality and documentation) for this feature:

2 Likes

This would be a great addition. What’s holding the PRs?

No idea. It’s like he just abandoned them. Does anyone know his username on these forums?