Added option to mention submissions

This commit is contained in:
Profitroll 2023-02-24 12:39:33 -05:00
parent 056fc52353
commit 64ae3fb047
2 changed files with 12 additions and 2 deletions

View File

@ -49,6 +49,11 @@
"move_sent": false, "move_sent": false,
"use_interval": false, "use_interval": false,
"interval": "1h30m", "interval": "1h30m",
"submitted_caption": {
"enabled": true,
"ignore_admins": true,
"text": "#submitted"
},
"extensions": { "extensions": {
"photo": [ "photo": [
"jpg", "jpg",

View File

@ -77,11 +77,16 @@ async def send_content(app: PosterClient) -> None:
else: else:
caption = "" caption = ""
if configGet("enabled", "posting", "submitted_caption") and ((submitted["user"] not in app.admins) or (configGet("ignore_admins", "posting", "submitted_caption") is True)):
caption = f"{caption}\n\n{configGet('text', 'posting', 'submitted_caption')}\n"
else:
caption = f"{caption}\n\n"
if configGet("enabled", "caption"): if configGet("enabled", "caption"):
if configGet("link", "caption") != None: if configGet("link", "caption") != None:
caption = f"{caption}\n\n[{configGet('text', 'caption')}]({configGet('link', 'caption')})" caption = f"{caption}[{configGet('text', 'caption')}]({configGet('link', 'caption')})"
else: else:
caption = f"{caption}\n\n{configGet('text', 'caption')}" caption = f"{caption}{configGet('text', 'caption')}"
else: else:
caption = caption caption = caption