mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fixes to discussions feature
This commit is contained in:
parent
f6e7e45a38
commit
dd4ff911fc
|
@ -56,9 +56,9 @@ def embed_formatter(post):
|
|||
embed["title"] = _("Created {title}").format(title=post["title"])
|
||||
embed["url"] = "{wikiurl}f/p/{threadId}".format(wikiurl=WIKI_SCRIPT_PATH, threadId=post["threadId"])
|
||||
if settings["fandom_discussions"]["appearance"]["embed"]["show_content"]:
|
||||
embed["description"] = post["rawContent"]
|
||||
embed["description"] = post["rawContent"] if len(post["rawContent"]) < 2000 else post["rawContent"][0:2000] + "…"
|
||||
embed["footer"]["text"] = post["forumName"]
|
||||
embed["timestamp"] = datetime.datetime.fromtimestamp(post["creationDate"]["epochSecond"]).isoformat()+"Z"
|
||||
embed["timestamp"] = datetime.datetime.fromtimestamp(post["creationDate"]["epochSecond"], tz=datetime.timezone.utc).isoformat()
|
||||
data["embeds"].append(dict(embed))
|
||||
data['avatar_url'] = settings["avatars"]["embed"]
|
||||
data['allowed_mentions'] = {'parse': []}
|
||||
|
|
Loading…
Reference in a new issue