add option to disable reply CWs

This commit is contained in:
Agatha Lovelace 2022-01-13 00:49:23 +02:00
parent 20bddbbc5e
commit 6cfe236526
3 changed files with 3 additions and 1 deletions

View File

@ -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). |

View File

@ -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,

View File

@ -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