Skip to content
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

add pp command #202

Merged
merged 1 commit into from
Jun 5, 2024
Merged
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
20 changes: 20 additions & 0 deletions bot/commands/fun/pp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from bot.base import Command
from bot.config import Embed
import random


class cmd(Command):
"""A discord command instance."""

name = "pp"
usage = "pp [word]"
description = "If an arg is provided, calculate pp size of arg, otherwise calculate pp size of user"

async def execute(self, arguments, message) -> None:
pp = message.author.name if not len(arguments) else arguments[0]
random.seed(pp)
pp_int=random.randint(0, 51)
pp_size = "8" + "".join("=" for p in range(pp_int)) + "D"
pp_rating = "smol" if pp_int < 18 else "avg" if pp_int < 36 else "chungo"
Copy link
Contributor

Choose a reason for hiding this comment

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

refactor this pls

embed = Embed(title=f"{pp}'s pp size \n\n**{pp_size}**\n\n*{pp_rating} pp*\n")
await message.reply(embed=embed)
Loading