Skip to content

Commit

Permalink
Add show_ids flag to activity command
Browse files Browse the repository at this point in the history
  • Loading branch information
WitherredAway committed Nov 1, 2024
1 parent 678dbed commit b757339
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cogs/poketwo_administration.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,9 @@ async def addshards(self, ctx, user: FetchUserConverter, amt: int, *, notes: Opt
embed=self.logs_embed(ctx.author, user, "Gave shards to", f"**Shards:** {amt}", notes), view=view
)

@manager.command(usage="[role=Moderator] [users: USER1 USER2 ...] [month: MONTH] [year: YEAR] [all-users: yes/no]")
@manager.command(
usage="[role=Moderator] [users: USER1 USER2 ...] [month: MONTH] [year: YEAR] [all-users: yes/no] [show-ids: yes/no]"
)
@checks.staff_categories_only()
@checks.is_server_manager()
@with_typing()
Expand Down Expand Up @@ -544,7 +546,11 @@ async def activity(
amount = min(max_amount, raw if total >= min_total else 0)

MAX_NAME_LENGTH = 13
name = member.name[:MAX_NAME_LENGTH] + ("..." if len(member.name) > MAX_NAME_LENGTH else "")
name = (
(member.name[:MAX_NAME_LENGTH] + ("..." if len(member.name) > MAX_NAME_LENGTH else ""))
if not args.show_ids
else str(member.id)
)
if tickets or bot_logs:
data.append(
[
Expand Down
7 changes: 7 additions & 0 deletions helpers/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ class ActivityArgs(commands.FlagConverter):
max_args=1,
default=False,
)
show_ids: Optional[bool] = commands.flag(
name="show-ids",
aliases=("ids", "id", "show-id"),
description="Whether or not to show user IDs instead of names.",
max_args=1,
default=False,
)
month: MonthConverter = commands.flag(
aliases=("m", "mo"),
description="The month",
Expand Down

0 comments on commit b757339

Please sign in to comment.