Adjust gay time
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 5s

This commit is contained in:
Nexus 2024-05-14 17:53:25 +01:00
parent 7a5da08a6e
commit 889e43398e

View file

@ -20,7 +20,7 @@ class MeterCog(commands.Cog):
await ctx.respond("Calculating...") await ctx.respond("Calculating...")
for i in range(0, 125, 25): for i in range(0, 125, 25):
await ctx.edit(content="Calculating... %d%%" % i) await ctx.edit(content="Calculating... %d%%" % i)
await asyncio.sleep(random.randint(1, 30) / 10) await asyncio.sleep(random.randint(1, 100) / 10)
pct = user.id % 100 pct = user.id % 100
await ctx.edit(content=f"{user.mention} is {pct}% gay.") await ctx.edit(content=f"{user.mention} is {pct}% gay.")
@ -29,16 +29,27 @@ class MeterCog(commands.Cog):
async def penis_meter(self, ctx: discord.ApplicationContext, user: discord.User = None): async def penis_meter(self, ctx: discord.ApplicationContext, user: discord.User = None):
"""Checks the length of someone's penis.""" """Checks the length of someone's penis."""
user = user or ctx.user user = user or ctx.user
n = random.randint(0, 100) n = self.cache.get(user) or random.randint(0, 100)
chunks = ["8"] chunks = ["8"]
chunks += ["="] * n chunks += ["="] * n
chunks.append("B") chunks.append("B")
self.cache[user] = n
return await ctx.respond( return await ctx.respond(
embed=discord.Embed( embed=discord.Embed(
title=f"{user.display_name}'s penis length:", title=f"{user.display_name}'s penis length:",
description="%d cm\n%s" % (n, "".join(chunks)) description="%d cm\n%s" % (n, "".join(chunks))
) )
) )
@commands.command()
@commands.is_owner()
async def clear_cache(self, ctx: commands.Context, user: discord.User = None):
"""Clears the Meter cache"""
if not user:
self.cache = {}
else:
self.cache.pop(user, None)
return await ctx.message.add_reaction("\N{white heavy check mark}")
def setup(bot): def setup(bot):