Skip to content

feat(penis): mods+ trumps all #314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion penis/penis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
import discord
from redbot.core import commands
from redbot.core.utils.chat_formatting import pagify
from redbot.core.utils.mod import is_mod_or_superior

DONG_DISTRIBUTION_CONST = 30
SMALL_DONG_CONST = 6
BIG_DONG_CONST = DONG_DISTRIBUTION_CONST - SMALL_DONG_CONST
VIP_DONG_CONST = DONG_DISTRIBUTION_CONST + 5


class Penis(commands.Cog):
"""Penis related commands."""
Expand All @@ -30,7 +33,7 @@

for user in users:
random.seed(user.id)
dongs[user] = "8{}D".format("=" * random.randint(0, DONG_DISTRIBUTION_CONST))
dongs[user] = "8{}D".format("=" * (random.randint(0, DONG_DISTRIBUTION_CONST), VIP_DONG_CONST)[await is_mod_or_superior(ctx.bot, user)])

Check failure on line 36 in penis/penis.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

penis/penis.py:36:128: E501 Line too long (148 > 127)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

insted of generating the vip dong everytime. move it into the constant


random.setstate(state)
dongs = sorted(dongs.items(), key=lambda x: x[1])
Expand All @@ -40,6 +43,9 @@
msg += "**{}'s size:**\n{}\nlol small\n".format(user.display_name, dong)
elif len(dong) <= BIG_DONG_CONST:
msg += "**{}'s size:**\n{}\n".format(user.display_name, dong)
elif len(dong) >= VIP_DONG_CONST:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the vip dong is moved into the constant check it with eq here insted. bit more readable

msg += "**{}'s size:**\n{}\nYou thought you could dick measure your way out of this one?\n"\
.format(user.display_name, dong)
else:
msg += "**{}'s size:**\n{}\nwow, now that's a dong!\n".format(user.display_name, dong)

Expand Down
Loading