From 0f631e003db3d0acf4ee5056e4403358f07fa2a5 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Tue, 25 Jun 2024 23:43:49 +0100 Subject: [PATCH] Alter the penis algorithm --- src/cogs/gay_meter.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/cogs/gay_meter.py b/src/cogs/gay_meter.py index 96828f1..6c73923 100644 --- a/src/cogs/gay_meter.py +++ b/src/cogs/gay_meter.py @@ -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)) ) )