mirror of
https://github.com/AgathaSorceress/mstdn-ebooks.git
synced 2024-11-20 03:25:53 +01:00
add option to disable reply CWs
This commit is contained in:
parent
20bddbbc5e
commit
6cfe236526
@ -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) |
|
| 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 | 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. |
|
| 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. |
|
| 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). |
|
| 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). |
|
||||||
|
1
main.py
1
main.py
@ -22,6 +22,7 @@ scopes = ["read:statuses", "read:accounts", "read:follows", "write:statuses", "r
|
|||||||
cfg = {
|
cfg = {
|
||||||
"site": "https://botsin.space",
|
"site": "https://botsin.space",
|
||||||
"cw": None,
|
"cw": None,
|
||||||
|
"cw_reply": False,
|
||||||
"instance_blacklist": ["bofa.lol", "witches.town", "knzk.me"], # rest in piece
|
"instance_blacklist": ["bofa.lol", "witches.town", "knzk.me"], # rest in piece
|
||||||
"learn_from_cw": False,
|
"learn_from_cw": False,
|
||||||
"mention_handling": 1,
|
"mention_handling": 1,
|
||||||
|
2
reply.py
2
reply.py
@ -81,7 +81,7 @@ class ReplyListener(mastodon.StreamListener):
|
|||||||
visibility = notification['status']['visibility']
|
visibility = notification['status']['visibility']
|
||||||
if visibility == "public":
|
if visibility == "public":
|
||||||
visibility = "unlisted"
|
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
|
print("replied with " + toot) # logging
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user