[RSS] Try for an image instead of assume

This commit is contained in:
aikaterna
2020-10-13 08:57:48 -07:00
committed by GitHub
parent 89f56d69eb
commit ddd8c14d03

View File

@@ -25,7 +25,7 @@ from .tag_type import INTERNAL_TAGS, VALID_IMAGES, TagType
log = logging.getLogger("red.aikaterna.rss")
__version__ = "1.1.19"
__version__ = "1.1.20"
class RSS(commands.Cog):
@@ -58,8 +58,11 @@ class RSS(commands.Cog):
if content_images:
for i, image in enumerate(content_images):
tag_name = f"content_image{str(i + 1).zfill(2)}"
rss_object[tag_name] = image["src"]
rss_object["is_special"].append(tag_name)
try:
rss_object[tag_name] = image["src"]
rss_object["is_special"].append(tag_name)
except KeyError:
pass
return rss_object
async def _add_feed(self, ctx, feed_name: str, channel: discord.TextChannel, url: str):