idk fandom

This commit is contained in:
Frisk 2021-09-07 18:00:07 +02:00
parent fea260caf8
commit 837fa6e674
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -118,14 +118,15 @@ async def feeds_embed_formatter(post_type, post, message_target, wiki, article_p
embed.event_type = "discussion/forum/poll" embed.event_type = "discussion/forum/poll"
embed["title"] = _("Created a poll \"{title}\"").format(title=escape_formatting(post["title"])) embed["title"] = _("Created a poll \"{title}\"").format(title=escape_formatting(post["title"]))
if message_target[0][1] > 1: if message_target[0][1] > 1:
poll = post["poll"] poll = post.get("poll", None)
image_type = False if poll is not None:
if poll["answers"][0]["image"] is not None: image_type = False
image_type = True if poll["answers"][0]["image"] is not None:
for num, option in enumerate(poll["answers"]): image_type = True
embed.add_field(option["text"] if image_type is True else _("Option {}").format(num+1), for num, option in enumerate(poll["answers"]):
option["text"] if image_type is False else _("__[View image]({image_url})__").format(image_url=option["image"]["url"]), embed.add_field(option["text"] if image_type is True else _("Option {}").format(num+1),
inline=True) option["text"] if image_type is False else _("__[View image]({image_url})__").format(image_url=option["image"]["url"]),
inline=True)
elif thread_funnel == "QUIZ": elif thread_funnel == "QUIZ":
embed.event_type = "discussion/forum/quiz" embed.event_type = "discussion/forum/quiz"
embed["title"] = _("Created a quiz \"{title}\"").format(title=escape_formatting(post["title"])) embed["title"] = _("Created a quiz \"{title}\"").format(title=escape_formatting(post["title"]))