From 8469919d4e51176bde844290f93025f11ac728d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Tue, 30 Jul 2024 02:05:56 +0200 Subject: [PATCH] Use author_name instead of title if user is using author_url --- discord_rss_bot/custom_message.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/discord_rss_bot/custom_message.py b/discord_rss_bot/custom_message.py index 40414f9..794444c 100644 --- a/discord_rss_bot/custom_message.py +++ b/discord_rss_bot/custom_message.py @@ -194,6 +194,12 @@ def replace_tags_in_embed(feed: Feed, entry: Entry) -> CustomEmbed: entry_read_modified: str = entry.read_modified.strftime("%Y-%m-%d %H:%M:%S") if entry.read_modified else "Never" entry_updated: str = entry.updated.strftime("%Y-%m-%d %H:%M:%S") if entry.updated else "Never" + if embed.title and not embed.author_name and embed.author_url: + msg = "You are using author_url without author_name, but has title set. We will use author_name instead of title when sending the embed to Discord." # noqa: E501 + logger.info(msg) + embed.author_name = embed.title + embed.title = "" + list_of_replacements: list[dict[str, str]] = [ {"{{feed_author}}": feed.author or ""}, {"{{feed_added}}": feed_added or ""},