async def getscores(ctx, *, arg=None): di = getArgs(arg) if not (di["-u"]).isnumeric(): user = str(di["-u"]).replace("+", " ").lower() cur.execute("select user_id from users where LOWER(username) = '" + user + "'") user_id = cur.fetchone()[0] else: user_id = di["-u"] di["-user"] = user_id if di.__contains__("-o") and di["-o"] == "count": query = "select status, count(*) from registered inner join beatmaps on registered.beatmap_id = beatmaps.beatmap_id" query = query + controller.buildWhereClause(di) query = query + " group by status order by status" cur.execute(query) s = "" for row in cur.fetchall(): s = s + "status = " + str(row[0]) + ": " + str(row[1]) + "\n" await ctx.send(s) elif di.__contains__("-o") and di["-o"] == "unplayed": di["-unplayed"] = "yes" embed = controller.getBeatmapList(di, cur) await ctx.send(embed=embed) else: embed = controller.getBeatmapList(di, cur, ["registered", "fc_count", "ss_count"]) await ctx.send(embed=embed)
async def unique_ss_list(ctx, *, arg=None): di = getArgs(arg) if not di.__contains__("-end"): di["-end"] = str(lastmonth) embed = controller.getBeatmapList(di, cur, ["unique_ss"]) await ctx.send(embed=embed) await updatelists()
async def toprated(ctx, *, arg=None): di = getArgs(arg) di["-order"] = "rating" di["-direction"] = "desc" embed = controller.getBeatmapList(di, cur, None, True) await ctx.send(embed=embed) await updatelists()
async def neverbeenfced(ctx, *, arg=None): di = getArgs(arg) if not di.__contains__("-end"): di["-end"] = str(lastweek) embed = controller.getBeatmapList(di, cur, ["neverbeenfced"]) await ctx.send(embed=embed) await updatelists()
async def least_ssed(ctx, *, arg=None): di = getArgs(arg) if not di.__contains__("-end"): di["-end"] = str(lastmonth) if not di.__contains__("-order"): di["-order"] = "ss_count, stars" embed = controller.getBeatmapList(di, cur, ["ss_count"]) await ctx.send(embed=embed) await updatelists()