Exemplo n.º 1
0
 def test_next_level_rr14l1_pretty(self):
     # Yes, this should return R14L0, since we don't have higher rank
     rr = RealmRanks("14L1")
     self.assertEqual(rr.next_level(pretty=True), "R14L0")
Exemplo n.º 2
0
async def who(ctx, player):
    try:
        char = PhoenixParser(player)
        p = char.info

        rr = RealmRanks(p.player_rr,
                        int(p.rp_all_time_amount.replace(",", "")))

        embed = discord.Embed(
            title="{}, ({} {})".format(
                p.player_name,
                p.player_race,
                p.player_class),
            url=p.player_url,
            description="Guild: {} - Level: {}".format(
                p.player_guild,
                p.player_level),
            color=p.realm_color
        )

        embed.add_field(
            name="Total: {} - {} ({})".format(
                p.rp_all_time_amount,
                p.player_rr,
                p.player_pretty_rr),
            value="Left to, {}: {}, {}: {}\n\
            Server: #{} - {}: #{} - {}: #{}".format(
                rr.next_rank(pretty=True),
                rr.next_rank(),
                rr.next_level(pretty=True),
                rr.next_level(),
                p.rp_all_time_server,
                p.player_realm,
                p.rp_all_time_realm,
                p.player_class,
                p.rp_all_time_class),
            inline=False)

        embed.add_field(
            name="Last Week: {}".format(
                p.rp_last_week_amount),
            value="Server: #{} - {}: #{} - {}: #{}".format(
                p.rp_last_week_server,
                p.player_realm,
                p.rp_last_week_realm,
                p.player_class,
                p.rp_last_week_class),
            inline=False)

        embed.add_field(
            name="This Week: {}".format(
                p.rp_this_week_amount),
            value="Server: #{} - {}: #{} - {}: #{}".format(
                p.rp_this_week_server,
                p.player_realm,
                p.rp_this_week_realm,
                p.player_class,
                p.rp_this_week_class),
            inline=False)

        embed.add_field(
            name="Last 48 hours: {}".format(
                p.rp_last_48h_amount),
            value="Server: #{} - {}: #{} - {}: #{}".format(
                p.rp_last_48h_server,
                p.player_realm,
                p.rp_last_48h_realm,
                p.player_class,
                p.rp_last_48h_class),
            inline=False)

        embed.set_footer(text="Updated: {}".format(p.last_updated))
        await ctx.send(embed=embed)
    except Exception:
        embed = discord.Embed(
            title="Unable to find player {}".format(player),
            description="This player does not exist or was misspelled",
            color=16312092
        )
        await ctx.send(embed=embed)
Exemplo n.º 3
0
 def test_next_level_rr14l1(self):
     # Yes, this should return rr14l0 value, since we don't have higher rank
     rr = RealmRanks("14L1")
     self.assertEqual(rr.next_level(), "187,917,143")
Exemplo n.º 4
0
 def test_next_level_rr5l9_pretty(self):
     rr = RealmRanks("5L9")
     self.assertEqual(rr.next_level(pretty=True), "R6L0")
Exemplo n.º 5
0
 def test_next_level_rr5l9(self):
     rr = RealmRanks("5L9")
     self.assertEqual(rr.next_level(), "1,010,625")
Exemplo n.º 6
0
 def test_next_level_rr1l2_pretty(self):
     rr = RealmRanks("1L2")
     self.assertEqual(rr.next_level(pretty=True), "R1L3")
Exemplo n.º 7
0
 def test_next_level_rr1l2(self):
     rr = RealmRanks("1L2")
     self.assertEqual(rr.next_level(), "125")