Skip to content

Commit 43c2346

Browse files
committed
new command, stacked
1 parent da0cd2a commit 43c2346

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

sizebot/cogs/objects.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,14 +463,40 @@ async def tags(self, ctx: BotContext):
463463
await ctx.send(out)
464464

465465
@commands.command(
466-
usage = "[object]",
466+
usage = "<object>",
467467
category = "objects"
468468
)
469469
@commands.guild_only()
470470
async def scaled(self, ctx: GuildContext, *, obj: DigiObject):
471471
userdata = load_or_fake(ctx.author)
472472
await ctx.send(f"{obj.article.capitalize()} {obj.name} scaled for {userdata.nickname} is {get_stats_sentence(obj, userdata.scale, userdata.unitsystem)}")
473473

474+
@commands.command(
475+
usage = "<object> [height]",
476+
category = "objects"
477+
)
478+
@commands.guild_only()
479+
async def stacked(self, ctx: GuildContext, obj: DigiObject, height: SV | None = None):
480+
userdata = load_or_fake(ctx.author)
481+
if height is None:
482+
height = userdata.height
483+
if obj.height:
484+
os = height / obj.height
485+
noun = "tall"
486+
elif obj.thickness:
487+
os = height / obj.thickness
488+
noun = "tall"
489+
elif obj.length:
490+
os = height / obj.length
491+
noun = "long"
492+
elif obj.diameter:
493+
os = height / obj.diameter
494+
noun = "long"
495+
else:
496+
os = height / obj.unitlength
497+
noun = "tall"
498+
await ctx.send(f"{height:.3mu} is {os:.2f} {obj.name_plural} {noun}.")
499+
474500

475501
async def setup(bot: commands.Bot):
476502
await bot.add_cog(ObjectsCog(bot))

0 commit comments

Comments
 (0)