webhook -> embed

Fixed occurences in the code to wrong name, fixed the name in settings example
This commit is contained in:
Frisk 2019-04-17 23:29:40 +02:00
parent a1635def26
commit e0a51f0d02
No known key found for this signature in database
GPG key ID: 0E9A7D3C0A01586C
2 changed files with 5 additions and 5 deletions

View file

@ -787,14 +787,14 @@ def embed_formatter(action, change, parsed_comment, categories):
logging.warning("No entry for {event} with params: {params}".format(event=action, params=change)) logging.warning("No entry for {event} with params: {params}".format(event=action, params=change))
embed["author"]["name"] = change["user"] embed["author"]["name"] = change["user"]
embed["author"]["url"] = author_url embed["author"]["url"] = author_url
embed["author"]["icon_url"] = settings["appearance"]["webhook"][action]["icon"] embed["author"]["icon_url"] = settings["appearance"]["embed"][action]["icon"]
embed["url"] = link embed["url"] = link
embed["description"] = parsed_comment embed["description"] = parsed_comment
if colornumber is None: if colornumber is None:
if settings["appearance"]["webhook"][action]["color"] is None: if settings["appearance"]["embed"][action]["color"] is None:
embed["color"] = random.randrange(1, 16777215) embed["color"] = random.randrange(1, 16777215)
else: else:
embed["color"] = settings["appearance"]["webhook"][action]["color"] embed["color"] = settings["appearance"]["embed"][action]["color"]
else: else:
embed["color"] = math.floor(colornumber) embed["color"] = math.floor(colornumber)
embed["timestamp"] = change["timestamp"] embed["timestamp"] = change["timestamp"]
@ -970,7 +970,7 @@ def day_overview(): # time.strftime('%Y-%m-%dT%H:%M:%S.000Z', time.gmtime(time.
embed["title"] = _("Daily overview") embed["title"] = _("Daily overview")
embed["url"] = "https://{wiki}.gamepedia.com/Special:Statistics".format(wiki=settings["wiki"]) embed["url"] = "https://{wiki}.gamepedia.com/Special:Statistics".format(wiki=settings["wiki"])
embed["color"] = settings["appearance"]["daily_overview"]["color"] embed["color"] = settings["appearance"]["daily_overview"]["color"]
embed["author"]["icon_url"] = settings["appearance"]["daily_overview"]["icon"] embed["author"]["icon_url"] = settings["appearance"]["embed"]["daily_overview"]["icon"]
embed["author"]["name"] = settings["wikiname"] embed["author"]["name"] = settings["wikiname"]
embed["author"]["url"] = "https://{wiki}.gamepedia.com/".format(wiki=settings["wiki"]) embed["author"]["url"] = "https://{wiki}.gamepedia.com/".format(wiki=settings["wiki"])
if activity: if activity:

View file

@ -28,7 +28,7 @@
"show_added_categories": true, "show_added_categories": true,
"appearance":{ "appearance":{
"mode": "embed", "mode": "embed",
"webhook": { "embed": {
"daily_overview": { "daily_overview": {
"color": 16312092, "color": 16312092,
"icon":"" "icon":""