mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Move compact emoji to class
This commit is contained in:
parent
88b22457a2
commit
546ccc0ada
|
@ -456,12 +456,17 @@
|
|||
"color": 1,
|
||||
"emoji": "👁️"
|
||||
},
|
||||
"discussion/forum/post": {
|
||||
"discussion": {
|
||||
"icon": "https://static.wikia.nocookie.net/663e53f7-1e79-4906-95a7-2c1df4ebbada",
|
||||
"color": 54998,
|
||||
"emoji": "📝"
|
||||
},
|
||||
"discussion/forum/reply": {
|
||||
"discussion/forum/post": {
|
||||
"icon": "https://static.wikia.nocookie.net/663e53f7-1e79-4906-95a7-2c1df4ebbada",
|
||||
"color": 54998,
|
||||
"emoji": "📝"
|
||||
},
|
||||
"discussion/forum/reply": {
|
||||
"icon": "https://static.wikia.nocookie.net/663e53f7-1e79-4906-95a7-2c1df4ebbada",
|
||||
"color": 54998,
|
||||
"emoji": "📝"
|
||||
|
@ -500,6 +505,16 @@
|
|||
"icon": "",
|
||||
"color": 0,
|
||||
"emoji": "❓"
|
||||
},
|
||||
"webhook/remove": {
|
||||
"icon": "https://raw.githubusercontent.com/Markus-Rost/discord-wiki-bot/master/dashboard/src/icon.png",
|
||||
"color": 0,
|
||||
"emoji": "<:wikibot:588723255972593672>"
|
||||
},
|
||||
"bot/exception": {
|
||||
"icon": "https://raw.githubusercontent.com/Markus-Rost/discord-wiki-bot/master/dashboard/src/icon.png",
|
||||
"color": 0,
|
||||
"emoji": "<:wikibot:588723255972593672>"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
import json, sys, logging
|
||||
|
||||
try: # load settings
|
||||
with open("settings.json") as sfile:
|
||||
with open("settings.json", encoding="utf8") as sfile:
|
||||
settings = json.load(sfile)
|
||||
if "user-agent" in settings["header"]:
|
||||
settings["header"]["user-agent"] = settings["header"]["user-agent"].format(version="1.0") # set the version in the useragent
|
||||
|
|
|
@ -50,6 +50,8 @@ class DiscordMessage:
|
|||
if message_type == "embed":
|
||||
self._setup_embed()
|
||||
elif message_type == "compact":
|
||||
if settings["event_appearance"].get(event_type, {"emoji": None})["emoji"]:
|
||||
content = settings["event_appearance"][event_type]["emoji"] + " " + content
|
||||
self.webhook_object["content"] = content
|
||||
self.length = len(content)
|
||||
|
||||
|
|
|
@ -71,8 +71,6 @@ async def feeds_compact_formatter(post_type, post, message_target, wiki, article
|
|||
else:
|
||||
message = _("Unknown event `{event}` by [{author}]({author_url}), report it on the [support server](<{support}>).").format(event=post_type, author=author, author_url=author_url, support=settings["support"])
|
||||
event_type = "unknown"
|
||||
if settings["event_appearance"].get(event_type, {"emoji": None})["emoji"]:
|
||||
message = settings["event_appearance"][event_type]["emoji"] + " " + message
|
||||
return DiscordMessage("compact", event_type, message_target[1], content=message, wiki=wiki)
|
||||
|
||||
|
||||
|
|
|
@ -575,8 +575,6 @@ async def compact_formatter(action, change, parsed_comment, categories, recent_c
|
|||
else:
|
||||
content = _("Unknown event `{event}` by [{author}]({author_url}), report it on the [support server](<{support}>).").format(event=action, author=author, author_url=author_url, support=settings["support"])
|
||||
action = "unknown"
|
||||
if settings["event_appearance"].get(action, {"emoji": None})["emoji"]:
|
||||
content = settings["event_appearance"][action]["emoji"] + " " + content
|
||||
return DiscordMessage("compact", action, message_target[1], content=content, wiki=WIKI_SCRIPT_PATH)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue