use typing to denote long operation in lb cmds
@@ -1571,6 +1571,7 @@ class Econ(commands.Cog):
@leaderboards.command(name="commands", aliases=["cmds"])
async def leaderboard_commands(self, ctx):
+ with ctx.typing():
# entry is Record(uid, amount, position)
# get + items from global leaderboard
cmds_global = sorted(list(self.d.cmd_lb.items()), key=(lambda e: e[1]), reverse=True)
@@ -1599,8 +1600,8 @@ class Econ(commands.Cog):
local_u_entry = (ctx.author.id, u_cmds_amount, entry[2])
break
- lb_global = self.lb_logic(cmds_global, global_u_entry, "\n`{0}.` **{0}**{1} {0}".format("{}", ":keyboard:"))
- lb_local = self.lb_logic(cmds_local, local_u_entry, "\n`{0}.` **{0}**{1} {0}".format("{}", ":keyboard:"))
+ lb_global = self.lb_logic(cmds_global[:10], global_u_entry, "\n`{0}.` **{0}**{1} {0}".format("{}", ":keyboard:"))
+ lb_local = self.lb_logic(cmds_local[:10], local_u_entry, "\n`{0}.` **{0}**{1} {0}".format("{}", ":keyboard:"))
embed = discord.Embed(color=self.d.cc, title=ctx.l.econ.lb.lb_cmds.format(":computer:"))
embed.add_field(name=ctx.l.econ.lb.local_lb, value=lb_local)
