Skip to content

Commit

Permalink
add tags to &objs
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiDuncan committed Nov 22, 2023
1 parent 16728b4 commit a0c248b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sizebot/cogs/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ def __init__(self, bot):

@commands.command(
aliases = ["objects", "objlist", "objectlist"],
category = "objects"
category = "objects",
usage = "[tag]"
)
async def objs(self, ctx):
async def objs(self, ctx, tag: str = None):
"""Get a list of the various objects SizeBot accepts."""
objectunits = []
for obj in objs.objects:
objectunits.append(obj.name)
if tag is not None:
if tag in obj.tags:
objectunits.append(obj.name)
else:
objectunits.append(obj.name)

objectunits.sort()

Expand Down

0 comments on commit a0c248b

Please sign in to comment.