msg_text="[{author}]({author_url}) created [{title}](<{url}f/p/{threadId}>) in {forumName}"
ifthread_funnel=="POLL":
msg_text="[{author}]({author_url}) created a poll [{title}](<{url}f/p/{threadId}>) in {forumName}"
elifthread_funnel!="TEXT":
discussion_logger.warning("The type of {} is an unknown discussion post type. Please post an issue on the project page to have it added https://gitlab.com/piotrex43/RcGcDw/-/issues.".format(thread_funnel))
message=_("[{author}]({author_url}) created a [reply](<{url}f/p/{threadId}/r/{postId}>) to [{title}](<{url}f/p/{threadId}>) in {forumName}").format(author=author,author_url=author_url,url=settings["fandom_discussions"]["wiki_url"],threadId=post["threadId"],postId=post["id"],title=post["_embedded"]["thread"][0]["title"],forumName=post["forumName"])
elifpost_type=="WALL":
user_wall=_("unknown")# Fail safe
ifpost["forumName"].endswith(' Message Wall'):
user_wall=post["forumName"][:-13]
ifnotpost["isReply"]:
message=_("[{author}]({author_url}) created [{title}](<{url}wiki/Message_Wall:{user_wall}?threadId={threadId}>) on [{user}'s Message Wall](<{url}wiki/Message_Wall:{user_wall}>)").format(author=author,author_url=author_url,title=post["title"],url=settings["fandom_discussions"]["wiki_url"],user=user_wall,user_wall=quote_plus(user_wall.replace("","_")),threadId=post["threadId"])
message=_("[{author}]({author_url}) created a [reply](<{url}wiki/Message_Wall:{user_wall}?threadId={threadId}#{replyId}>) to [{title}](<{url}wiki/Message_Wall:{user_wall}?threadId={threadId}>) on [{user}'s Message Wall](<{url}wiki/Message_Wall:{user_wall}>)").format(author=author,author_url=author_url,url=settings["fandom_discussions"]["wiki_url"],title=post["_embedded"]["thread"][0]["title"],user=user_wall,user_wall=quote_plus(user_wall.replace("","_")),threadId=post["threadId"],replyId=post["id"])
discussion_logger.warning("Article comments are not yet implemented. For reasons see https://gitlab.com/piotrex43/RcGcDw/-/issues/126#note_366480037")
article_page=_("unknown")# No page known
ifnotpost["isReply"]:
message=_("[{author}]({author_url}) created a [comment](<{url}wiki/{article}?commentId={commentId}>) on [{article}](<{url}wiki/{article}>)").format(author=author,author_url=author_url,url=settings["fandom_discussions"]["wiki_url"],article=article_page,commentId=post["threadId"])
else:
message=_("[{author}]({author_url}) created a [reply](<{url}wiki/{article}?threadId={threadId}) to a [comment](<{url}wiki/{article}?commentId={commentId}&replyId={replyId}>) on [{article}](<{url}wiki/{article}>)").format(author=author,author_url=author_url,url=settings["fandom_discussions"]["wiki_url"],article=article_page,commentId=post["threadId"],replyId=post["id"])
else:
discussion_logger.warning("The type of {} is an unknown discussion post type. Please post an issue on the project page to have it added https://gitlab.com/piotrex43/RcGcDw/-/issues.".format(post_type))
discussion_logger.warning("The type of {} is an unknown discussion post type. Please post an issue on the project page to have it added https://gitlab.com/piotrex43/RcGcDw/-/issues.".format(thread_funnel))
else:
embed.event_type="discussion/forum/reply"
embed["title"]=_("Replied to \"{title}\"").format(title=post["_embedded"]["thread"][0]["title"])
embed["title"]=_("Replied to a comment on {article}").format(article=article_page)
embed["footer"]["text"]=article_page
else:
discussion_logger.warning("The type of {} is an unknown discussion post type. Please post an issue on the project page to have it added https://gitlab.com/piotrex43/RcGcDw/-/issues.".format(post_type))