diff options
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -54,7 +54,7 @@ async def on_ready(): await connect(source_db, dest_db) await bot.change_presence( game=discord.Game( - name="alpha.vainsocial.com")) + name="vainsocial.com")) @bot.command() @@ -65,7 +65,7 @@ async def about(): description="Built by the Vainsocial development team using the MadGlory API. Currently running on %i servers." % (len(bot.servers),) ) emb.add_field(name="Website", - value="https://alpha.vainsocial.com/?utm_source=discord&utm_medium=vainsocial") + value="https://vainsocial.com/?utm_source=discord&utm_medium=vainsocial") emb.add_field(name="Bot invite link", value="https://discordapp.com/oauth2/authorize?&client_id=287297889024213003&scope=bot") emb.add_field(name="Developer Discord", @@ -80,6 +80,8 @@ async def vainsocial(name: str, region: str = None): """Retrieves a player's stats.""" query = """ SELECT + participant_stats_scorelabels.label AS score_label, + ROUND((100*score)::NUMERIC, 0) AS score, player.name, player.shard_id, match.game_mode, @@ -88,10 +90,14 @@ async def vainsocial(name: str, region: str = None): participant.kills, participant.deaths, participant.assists, participant.farm, player.skill_tier, player.played, player.wins, player.last_match_created_date::text - FROM match, roster, participant, player where + FROM match, roster, participant, player, participant_stats, participant_stats_scorelabels WHERE match.api_id=roster.match_api_id AND roster.api_id=participant.roster_api_id AND participant.player_api_id=player.api_id AND + participant_stats.participant_api_id=participant.api_id AND + participant.winner=participant_stats_scorelabels.winner AND + participant_stats_scorelabels.lower <= participant_stats.score AND + participant_stats.score < participant_stats_scorelabels.upper AND player.name=$1 AND player.last_match_created_date::text<>$2 ORDER BY match.created_at DESC LIMIT 1 @@ -120,19 +126,19 @@ async def vainsocial(name: str, region: str = None): emb = discord.Embed( title="%(name)s" % data, - url="https://alpha.vainsocial.com/players/%(shard_id)s/%(name)s/?utm_source=discord&utm_medium=vainsocial" % data + url="https://vainsocial.com/players/%(shard_id)s/%(name)s/?utm_source=discord&utm_medium=vainsocial" % data ) emb.set_author(name="Vainsocial", - url="https://alpha.vainsocial.com") + url="https://vainsocial.com") emb.add_field(name="Profile", value=("%(wins)i wins / %(played)i games\n" + - "https://alpha.vainsocial.com/players/%(shard_id)s/%(name)s/?utm_source=discord&utm_medium=vainsocial") % data) + "https://vainsocial.com/players/%(shard_id)s/%(name)s/?utm_source=discord&utm_medium=vainsocial") % data) emb.add_field(name="Last match", value=("%(result)s %(mode)s as %(hero)s %(kills)i/%(deaths)i/%(assists)i\n" + - "https://alpha.vainsocial.com/matches/%(match_api_id)s/?utm_source=discord&utm_medium=vainsocial") % data) + "https://vainsocial.com/matches/%(match_api_id)s/?utm_source=discord&utm_medium=vainsocial") % data) emb.set_footer(text="Vainsocial - Vainglory social stats service") - emb.set_thumbnail(url="https://alpha.vainsocial.com/images/game/skill_tiers/%(skill_tier)s.png" % data) + emb.set_thumbnail(url="https://vainsocial.com/images/game/skill_tiers/%(skill_tier)s.png" % data) return emb async with pool.acquire() as con: |
