Beispiel #1
0
async def avg(ctx, ign):
    player = fm.Player(ign)
    await ctx.send("*GETTING GAMES...*")
    stats = player.avg_stats

    await ctx.send(
        f'**games:** {stats["games"]}  |  **role:** {stats["role"]}\n'
        f'**ppg:** {round(stats["ppg"], 2)}   |  **kda:** {stats["kda"]} ({round(stats["kdad"], 2)})\n'
        f'csm: {round(stats["csm"], 2)}  |  vision:{round(stats["vision"], 1)}\n*totals: {stats["totals"]}*'
    )
Beispiel #2
0
async def history(ctx, ign):
    player = fm.Player(ign)
    await ctx.send('*GETTING GAMES...*')
    stats, gavg, role = player.weekly_soloq_stats()
    await ctx.send(f'\n***AVERAGE: {round(gavg, 2)} | ROLE: {role}***'
                   )  # this is legit so f*****g bugged
    t = 0

    for stat in stats:
        t += stat
        s = stats[stat]
        await ctx.send(
            f'-----\n**{s["score"]} POINTS**\n *{s["duration"]}*   **{s["kda"]}** on {s["champ"]}\n {s["csm"]} *cs/m*'
            f'     {round(s["kp"]*100, 2)} *%kp*     {s["vision"]} *vision*')
Beispiel #3
0
async def top2(ctx, ign, n_games=2):
    player = fm.Player(ign)
    await ctx.send('*GETTING GAMES...*')
    resp = player.get_top_games(n_games)

    if resp == 404:
        await ctx.send('NO GAMES FOUND!')
        g_sum, g_avg, stats = 0, 0, 0
    else:
        g_sum, g_avg, stats = resp

    for stat in stats:
        s = stat
        rkp = round(s["kp"] * 100, 2)
        await ctx.send(
            f'-----\n**{s["score"]} POINTS**\n *{s["duration"]}*   **{s["kda"]}** on {s["champ"]}\n {rkp} *%kp*    '
            f'{s["csm"]} *cs/m*   {s["vision"]} *vision* *{s["role"].lower()}*'
        )
    await ctx.send(f'**POINTS: {round(g_sum, 1)}**')
Beispiel #4
0
async def top2(ctx, ign, n_games=2):
    player = fm.Player(ign)
    await ctx.send('*GETTING GAMES...*')
    resp = player.get_top_games(n_games)

    if resp == 404:
        await ctx.send('NO GAMES FOUND!')
        g_sum, g_avg, stats = 0, 0, 0
    else:
        g_sum, g_avg, stats = resp

    pasta = discord.Embed(
        title=f"Top Two Games for `{ign}`",
        color=discord.Color(int('DAB420', 16)),
        description=f'**{g_sum}** pts  *({round(g_avg, 1)} avg)*')
    pasta.set_thumbnail(
        url=
        f'http://ddragon.leagueoflegends.com/cdn/10.18.1/img/profileicon/{player.icon}.png'
    )

    i = 1  # just to count which game youre on
    for game in stats:  # append all the fields to the embed
        pasta.add_field(name=f'`\nGAME {i}`',
                        value='+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+',
                        inline=False)
        game['kp'] = round(100 * game['kp'],
                           2)  # times then round bc is less than 1
        del game['*cc']  # f**k this stat

        i += 1
        for stat in game:
            rounded_stat = game[stat] if type(
                game[stat]) is not int else round(game[stat],
                                                  2)  # round normal nums
            pasta.add_field(name=stat, value=rounded_stat)

    await ctx.send(embed=pasta)