Beispiel #1
0
    async def units(self, ctx):
        """Get a list of the various units SizeBot accepts."""
        heightobjectunits = [su.unit for su in SV._systems["o"]._systemunits]
        weightobjectunits = [su.unit for su in WV._systems["o"]._systemunits]

        heightunits = [
            str(u) for u in sorted(SV._units) if u not in heightobjectunits
        ]
        weightunits = [
            str(u) for u in sorted(WV._units) if u not in weightobjectunits
        ]

        embed = Embed(title=f"Units [SizeBot {__version__}]")

        for n, units in enumerate(
                utils.chunkList(heightunits, math.ceil(len(heightunits) / 3))):
            embed.add_field(name="Height" if n == 0 else "\u200b",
                            value="\n".join(units))

        for n, units in enumerate(
                utils.chunkList(weightunits, math.ceil(len(weightunits) / 3))):
            embed.add_field(name="Weight" if n == 0 else "\u200b",
                            value="\n".join(units))

        await ctx.send(embed=embed)
Beispiel #2
0
async def create_stats_screen(players) -> Image:
    image_list = [await p.get_image() for p in sorted(players.values())]
    height = math.ceil(math.sqrt(len(image_list)))

    images = [merge_images(chunk) for chunk in chunkList(image_list, height)]

    return merge_images_vertical(images)
Beispiel #3
0
def edir(o):
    """send embed of an object's attributes, with type notation"""
    e = Embed(title=utils.getFullname(o))
    attrs = [eformat(n, v) for n, v in utils.ddir(o).items()]
    pageLen = math.ceil(len(attrs) / 3)
    for page in utils.chunkList(attrs, pageLen):
        e.add_field(value="\n".join(page))
    return e
Beispiel #4
0
    async def objs(self, ctx):
        """Get a list of the various objects SizeBot accepts."""
        objectunits = []
        for obj in objs.objects:
            objectunits += obj.singularNames

        objectunits.sort()

        embed = Embed(title=f"Objects [SizeBot {__version__}]")

        for n, units in enumerate(
                utils.chunkList(objectunits, math.ceil(len(objectunits) / 3))):
            embed.add_field(name="Objects" if n == 0 else "\u200b",
                            value="\n".join(units))

        await ctx.send(embed=embed)
Beispiel #5
0
    async def objs(self, ctx):
        """Get a list of the various objects SizeBot accepts."""
        objectunits = []
        for obj in objs.objects:
            objectunits.append(obj.name)

        objectunits.sort()

        embed = Embed(
            title=f"Objects [SizeBot {__version__}]",
            description=
            f"*NOTE: All of these objects have multiple aliases. If there is an alias that you think should work for a listed object but doesn't, report it with `{ctx.prefix}suggestobject` and note that it's an alias.*"
        )

        for n, units in enumerate(
                utils.chunkList(objectunits, math.ceil(len(objectunits) / 6))):
            embed.add_field(name="Objects" if n == 0 else "\u200b",
                            value="\n".join(units))

        await ctx.send(embed=embed)