From b2788d02890dffa5ff0fae90e37e883dd82be093 Mon Sep 17 00:00:00 2001 From: Johnny Gear Date: Thu, 13 Nov 2025 22:03:20 -0600 Subject: [PATCH] Mastodon - visibility from env --- mastodon.py | 4 ++-- settings.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mastodon.py b/mastodon.py index 6d30abc..1a9bcd6 100644 --- a/mastodon.py +++ b/mastodon.py @@ -1,6 +1,6 @@ import logging -from settings import MASTODON_INSTANCE, MASTODON_ACCESS_TOKEN +from settings import MASTODON_INSTANCE, MASTODON_ACCESS_TOKEN, MASTODON_VISIBILITY API_STATUSES = '/api/v1/statuses' API_STATUS_CONTEXT = '/api/v1/statuses/%(id)s/context' @@ -53,7 +53,7 @@ class Mastodon: API_STATUSES, data={ 'status': status, - 'visibility': 'direct', + 'visibility': MASTODON_VISIBILITY, 'in_reply_to_id': in_reply_to_id }) diff --git a/settings.py b/settings.py index c2a3e50..ad4460d 100644 --- a/settings.py +++ b/settings.py @@ -9,6 +9,7 @@ MASTODON_USERNAME = os.environ.get('MASTODON_USERNAME') MASTODON_INSTANCE = os.environ.get("MASTODON_INSTANCE") MASTODON_ACCESS_TOKEN = os.environ.get('MASTODON_ACCESS_TOKEN') +MASTODON_VISIBILITY = os.environ.get('MASTODON_VISIBILITY', 'direct') TELEGRAM_API_TOKEN = os.environ.get('TELEGRAM_API_TOKEN') TELEGRAM_CHAT_ID = int(os.environ.get('TELEGRAM_CHAT_ID'))