From be8f0262d043ef1f07d0f0e6858758dfdef34207 Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Wed, 15 Mar 2023 21:58:14 +0100 Subject: [PATCH] This commit closes #11 --- config.json | 6 ++++-- modules/sender.py | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config.json b/config.json index 96ebd2f..191f736 100644 --- a/config.json +++ b/config.json @@ -86,8 +86,10 @@ }, "caption": { "enabled": false, - "text": "sample text", - "link": null + "link": null, + "text": [ + "sample text" + ] }, "submission": { "timeout": 30, diff --git a/modules/sender.py b/modules/sender.py index e57dab6..ed4de5a 100644 --- a/modules/sender.py +++ b/modules/sender.py @@ -1,5 +1,6 @@ from datetime import datetime from os import makedirs, path +from random import choice from shutil import rmtree from traceback import format_exc from uuid import uuid4 @@ -129,9 +130,9 @@ async def send_content(app: PosterClient) -> None: if configGet("enabled", "caption"): if configGet("link", "caption") != None: - caption = f"{caption}[{configGet('text', 'caption')}]({configGet('link', 'caption')})" + caption = f"{caption}[{choice(configGet('text', 'caption'))}]({configGet('link', 'caption')})" else: - caption = f"{caption}{configGet('text', 'caption')}" + caption = f"{caption}{choice(configGet('text', 'caption'))}" else: caption = caption