Compare commits
7 Commits
8339921f93
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b931f05fa1 | |||
| 357ea51066 | |||
| e4534bcace | |||
| e2ae5bd885 | |||
| 1eb9a32683 | |||
| dba0930e3e | |||
| 4350236ea7 |
Submodule src/modules/voicelog updated: dff1eb3185...0cfc9b9986
@@ -41,7 +41,11 @@ class YarnCog(LionCog):
|
|||||||
|
|
||||||
@LionCog.listener("on_reaction_remove")
|
@LionCog.listener("on_reaction_remove")
|
||||||
async def lilac_unconfirms(self, reaction: discord.Reaction, user: discord.User):
|
async def lilac_unconfirms(self, reaction: discord.Reaction, user: discord.User):
|
||||||
if reaction.me and reaction.count == 1:
|
if (
|
||||||
|
reaction.me
|
||||||
|
and reaction.count == 1
|
||||||
|
and reaction.message.author.id != self.bot.user.id
|
||||||
|
):
|
||||||
await reaction.remove(self.bot.user)
|
await reaction.remove(self.bot.user)
|
||||||
|
|
||||||
@cmds.hybrid_command(name="voicestate")
|
@cmds.hybrid_command(name="voicestate")
|
||||||
@@ -97,9 +101,10 @@ class YarnCog(LionCog):
|
|||||||
total_time="SUM(COALESCE(duration, EXTRACT(EPOCH FROM (NOW() - joined_at))))",
|
total_time="SUM(COALESCE(duration, EXTRACT(EPOCH FROM (NOW() - joined_at))))",
|
||||||
)
|
)
|
||||||
.order_by("total_time", ORDER.DESC)
|
.order_by("total_time", ORDER.DESC)
|
||||||
|
.group_by("userid")
|
||||||
.with_no_adapter()
|
.with_no_adapter()
|
||||||
)
|
)
|
||||||
leaderboard = [(row["userid"], row["total_time"]) for row in await query]
|
leaderboard = [(row["userid"], int(row["total_time"])) for row in await query]
|
||||||
|
|
||||||
# Format for display and pager
|
# Format for display and pager
|
||||||
# First collect names
|
# First collect names
|
||||||
@@ -108,7 +113,7 @@ class YarnCog(LionCog):
|
|||||||
user = ctx.guild.get_member(uid)
|
user = ctx.guild.get_member(uid)
|
||||||
if user is None:
|
if user is None:
|
||||||
try:
|
try:
|
||||||
user = await ctx.bot.fetch_member(uid)
|
user = await ctx.guild.fetch_member(uid)
|
||||||
except discord.NotFound:
|
except discord.NotFound:
|
||||||
user = None
|
user = None
|
||||||
names[uid] = user.display_name if user else str(uid)
|
names[uid] = user.display_name if user else str(uid)
|
||||||
@@ -126,4 +131,4 @@ class YarnCog(LionCog):
|
|||||||
title = "Voice Leaderboard"
|
title = "Voice Leaderboard"
|
||||||
pages = paginate_list(lb_strings, block_length=page_len, title=title)
|
pages = paginate_list(lb_strings, block_length=page_len, title=title)
|
||||||
|
|
||||||
await ctx.pager(pages)
|
await pager(ctx, pages)
|
||||||
|
|||||||
Reference in New Issue
Block a user