Alter the penis algorithm
All checks were successful
Build and Publish / build_and_publish (push) Successful in 1m7s

This commit is contained in:
Nexus 2024-06-25 23:43:49 +01:00
parent ae968be9de
commit 0f631e003d
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -13,6 +13,7 @@ class MeterCog(commands.Cog):
self.cache = {}
@commands.slash_command(name="gay-meter")
@discord.guild_only()
async def gay_meter(self, ctx: discord.ApplicationContext, user: discord.User = None):
"""Checks how gay someone is"""
user = user or ctx.user
@ -21,23 +22,34 @@ class MeterCog(commands.Cog):
for i in range(0, 125, 25):
await ctx.edit(content="Calculating... %d%%" % i)
await asyncio.sleep(random.randint(1, 30) / 10)
pct = user.id % 100
if random.randint(0, 1):
pct = sum((user.id, ctx.user.id, ctx.channel.id, ctx.guild.id)) % 400
else:
pct = user.id % 100
await ctx.edit(content=f"{user.mention} is {pct}% gay.")
@commands.slash_command(name="penis-length")
async def penis_meter(self, ctx: discord.ApplicationContext, user: discord.User = None):
"""Checks the length of someone's penis."""
user = user or ctx.user
n = self.cache.get(user) or random.randint(0, 100)
if random.randint(0, 1):
pct = sum((user.id, ctx.user.id)) % 200
else:
pct = user.id % 125
pct = pct
chunks = ["8"]
chunks += ["="] * n
chunks += ["="] * pct
chunks.append("B")
self.cache[user] = n
inch = pct * 0.3937008
im = "inch"
if pct > 30.48:
im = "ft"
inch = pct * 0.0328084
return await ctx.respond(
embed=discord.Embed(
title=f"{user.display_name}'s penis length:",
description="%d cm\n%s" % (n, "".join(chunks))
description="%d cm (%.2f%s)\n%s" % (pct, inch, im, "".join(chunks))
)
)