瀏覽代碼

Fix AniList user url in feed

Lucas Villeneuve 5 年之前
父節點
當前提交
cf1f949d10
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 1 0
      src/globals.py
  2. 2 1
      src/myanimebot.py

+ 1 - 0
src/globals.py

@@ -58,6 +58,7 @@ SERVICE_ANILIST="AniList"
 SERVICE_MAL="mal"
 MAL_URL="https://myanimelist.net/"
 MAL_PROFILE_URL="https://myanimelist.net/profile/"
+ANILIST_PROFILE_URL="https://anilist.co/user/"
 
 # class that send logs to DB
 class LogDBHandler(logging.Handler):

+ 2 - 1
src/myanimebot.py

@@ -47,13 +47,14 @@ def build_embed(user, item_title, item_link, item_description, pub_date, image,
 	# Get service
 	if service == utils.Service.MAL:
 		service_name = 'MyAnimeList'
+		profile_url = "{}{}".format(globals.MAL_PROFILE_URL, user)
 	elif service == utils.Service.ANILIST:
 		service_name = 'AniList'
+		profile_url = "{}{}".format(globals.ANILIST_PROFILE_URL, user)
 	else:
 		raise NotImplementedError('Unknown service {}'.format(service))
 	description = "[{}]({})\n```{}```".format(utils.filter_name(item_title), item_link, item_description)
 	profile_url_label = "{}'s {}".format(user, service_name)
-	profile_url = "{}{}".format(globals.MAL_PROFILE_URL, user)
 
 	try:	
 		embed = discord.Embed(colour=0xEED000,