From f326f953ed667a75c005a5261a35c1da4926f775 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Tue, 8 Sep 2020 09:56:42 -0700 Subject: [PATCH] Adding all other classes to the embed --- app/ffxiv.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/ffxiv.py b/app/ffxiv.py index 83201ad5..7a58a28f 100644 --- a/app/ffxiv.py +++ b/app/ffxiv.py @@ -38,7 +38,7 @@ def make_request(name, server): current_class_name = current_class['Job']['Name'] current_class_level = character['ActiveClassJob']['Level'] xp_to_level_up = current_class['ExpLevelTogo'] - class_icon = "https://xivapi.com/%s" % current_class['Job']['Icon'] + job_icon = "https://xivapi.com/%s" % current_class['Job']['Icon'] if character['GrandCompany']['Company']: grand_company = character['GrandCompany'] @@ -56,7 +56,7 @@ def make_request(name, server): embed = discord.Embed(description=character['Name'], color=0x428bca, type="rich") embed.set_author(name="FFXIV API bullshit for %s\nPlayer ID: %s" % (character['Name'], character['ID']), icon_url="http://na.lodestonenews.com/images/thumbnail.png") - embed.set_thumbnail(url=class_icon) + embed.set_thumbnail(url=job_icon) embed.add_field(name="Current Class", value="%s - Lvl: %s" % (current_class_name, current_class_level), inline=True) embed.add_field(name="XP to level up", value=xp_to_level_up, inline=True) embed.add_field(name="Race", value=character['Race']['Name'], inline=True) @@ -80,9 +80,16 @@ def make_request(name, server): ) else: embed.add_field(name="Free Company", value="Not in a Free Company", inline=False) + embed.set_image(url=character['Portrait']) + embed.add_field(name="All other classes", value="-----", inline=False) + all_classes = character['ClassJobs'] + for job in all_classes: + job_icon = "https://xivapi.com%s" % job['Job']['Icon'] + embed.add_field( + name=job['Job']['Abbreviation'], + value=job['Level'], inline=True + ) + embed.set_footer(text='Feel free to use my refer a friend code: MA9Q49CJ') - # embed.add_field(name=':hospital: Recovered Cases :hospital:', value=recovered, inline=False) - # embed.add_field(name=':skull_crossbones: Deaths :skull_crossbones:', value=deaths, inline=False) - # embed.add_field(name='Source', value='https://github.com/CSSEGISandData/COVID-19') return embed