Beispiel #1
0
async def graph(ctx, player=None, map=None, skin=None):
    if player and map:
        # get the PIL image of the graph
        graph_figure = con.graph_builder(player=player,
                                         map=map,
                                         limit=50,
                                         skin=skin)

        if graph_figure == 50:
            await ctx.send(
                con.markup(
                    "Zero results with datetime not null or above 6 minutes found"
                ))

        # setup the buffer
        output_buffer = BytesIO()

        # save the image as binary
        graph_figure.savefig(output_buffer, format="png")

        # set the offset
        output_buffer.seek(0)

        # send the image
        await ctx.send(
            file=File(fp=output_buffer, filename="srb2_circuit_graph.png"))
    else:
        await ctx.send(con.markup("Required parameters not given"))
Beispiel #2
0
async def graph(ctx, player=None, map=None, *args):
    if player and map:
        # get the PIL image of the graph
        graph_figure = con.graph_builder(player=player,
                                         map=map,
                                         limit=50,
                                         params=args)

        if graph_figure == 50:
            await ctx.send(
                con.markup(
                    "Couldn't build graph. Try checking the parameters and how they are written"
                ))

        # setup the buffer
        output_buffer = BytesIO()

        # save the image as binary
        graph_figure.savefig(output_buffer, format="png")

        # set the offset
        output_buffer.seek(0)

        # send the image
        await ctx.send(
            file=File(fp=output_buffer, filename="srb2_circuit_graph.png"))
    else:
        await ctx.send(con.markup("Required parameters not given"))
Beispiel #3
0
async def search(ctx, map=None, skin=None, player=None):
    # if no map was specified
    if not map:
        # give error message
        await ctx.send(
            con.markup("No map was found. Retry by specifying a map."))
    else:
        await ctx.send(
            con.search_result_to_message(
                con.get_search_result(map, skin, player)))
Beispiel #4
0
async def search(ctx, map=None, *args):
    # if no map was specified
    if not map:
        # give error message
        await ctx.send(
            con.markup("No map was specified. Retry by specifying a map."))
    else:
        await ctx.send(
            con.search_result_to_message(
                con.get_search_result(
                    parameters=["-mapname", map, "-limit", "3"] + list(args))))
Beispiel #5
0
async def mods(ctx):
    await ctx.send(con.markup(con.get_mods()))