Skip to content

Commit

Permalink
chore: modify queue string
Browse files Browse the repository at this point in the history
  • Loading branch information
Skelmis committed Nov 3, 2024
1 parent a3aac7f commit 7278731
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions suggestions/core/suggestions_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,31 @@ async def virtual_reject_button(self, ih: InteractionHandler, pid: str):
async def info(self, ih: InteractionHandler):
guild_id = ih.interaction.guild_id
guild_config: GuildConfig = await GuildConfig.from_id(guild_id, self.state)
count: int = await self.queued_suggestions_db.count(
AQ(AND(EQ("guild_id", guild_id), EQ("still_in_queue", True)))
virtual_count: int = await self.queued_suggestions_db.count(
AQ(
AND(
EQ("guild_id", guild_id),
EQ("still_in_queue", True),
Negate(Exists("message_id")),
),
)
)
physical_count: int = await self.queued_suggestions_db.count(
AQ(
AND(
EQ("guild_id", guild_id),
EQ("still_in_queue", True),
Exists("message_id"),
),
)
)
icon_url = await self.bot.try_fetch_icon_url(guild_id)
guild = self.state.guild_cache.get_entry(guild_id)
embed = disnake.Embed(
title="Queue Info",
timestamp=self.bot.state.now,
description=f"`{count}` suggestions currently in queue.\n"
description=f"`{virtual_count}` suggestions currently in a virtual queue.\n"
f"`{physical_count}` suggestions in a physical queue.\n"
f"New suggestions will {'' if guild_config.uses_suggestion_queue else 'not'} be "
f"sent to the suggestions queue.",
colour=self.bot.colors.embed_color,
Expand Down

0 comments on commit 7278731

Please sign in to comment.