From 6cfe236526f5304c28fe64a303e89970a8e2703d Mon Sep 17 00:00:00 2001 From: Agatha Lovelace Date: Thu, 13 Jan 2022 00:49:23 +0200 Subject: [PATCH] add option to disable reply CWs --- README.md | 1 + main.py | 1 + reply.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a4c4d86..2a4e486 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Configuring mstdn-ebooks is accomplished by editing `config.json`. If you want t |--------------------------|-----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | site | https://botsin.space | The instance your bot will log in to and post from. This must start with `https://` or `http://` (preferably the latter) | | cw | null | The content warning (aka subject) mstdn-ebooks will apply to non-error posts. | +| cw_reply | false | If true, replies will be CW'd | | instance_blacklist | ["bofa.lol", "witches.town", "knzk.me"] | If your bot is following someone from a blacklisted instance, it will skip over them and not download their posts. This is useful for ensuring that mstdn-ebooks doesn't waste time trying to download posts from dead instances, without you having to unfollow the user(s) from them. | | learn_from_cw | false | If true, mstdn-ebooks will learn from CW'd posts. | | mention_handling | 1 | 0: Never use mentions. 1: Only generate fake mentions in the middle of posts, never at the start. 2: Use mentions as normal (old behaviour). | diff --git a/main.py b/main.py index e6fd49e..4aedb01 100755 --- a/main.py +++ b/main.py @@ -22,6 +22,7 @@ scopes = ["read:statuses", "read:accounts", "read:follows", "write:statuses", "r cfg = { "site": "https://botsin.space", "cw": None, + "cw_reply": False, "instance_blacklist": ["bofa.lol", "witches.town", "knzk.me"], # rest in piece "learn_from_cw": False, "mention_handling": 1, diff --git a/reply.py b/reply.py index dd694dd..799313e 100755 --- a/reply.py +++ b/reply.py @@ -81,7 +81,7 @@ class ReplyListener(mastodon.StreamListener): visibility = notification['status']['visibility'] if visibility == "public": visibility = "unlisted" - client.status_post(toot, post_id, visibility=visibility, spoiler_text=cfg['cw']) # send toost + client.status_post(toot, post_id, visibility=visibility, spoiler_text=cfg['cw'] if cfg['cw_reply'] else None) # send toost print("replied with " + toot) # logging