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 alumni badge to user after being demoted from Beatmap Nomination using !removebn. #186

Open
wants to merge 1 commit 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
1 change: 1 addition & 0 deletions constants/chatbotCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ async def removebn(fro: str, chan: str, message: list[str]) -> str:
)
await user_utils.set_privileges(targetID, new_privileges)
await user_utils.remove_user_badge(targetID, badges.BEATMAP_NOMINATION)
await user_utils.add_user_badge(targetID, badges.ALUMNI)
Copy link
Member

Choose a reason for hiding this comment

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

should only happen in the case where the user no longer has any staff permissions (e.g. they may also be a chat mod or admin, and just have their bn removed)

Copy link
Member

@cmyui cmyui Oct 21, 2024

Choose a reason for hiding this comment

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

just realized lines 272 & 273:

        & ~privileges.USER_DONOR
        & ~privileges.USER_PREMIUM

these should also only change when the user no longer has any staff perms

Copy link
Member

Choose a reason for hiding this comment

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

!addbn should then do the opposite, removing alumni if they already have it & are becoming a staff member again

await user_utils.set_absolute_donor_expiry_time(targetID, 0)
target_tokens = await osuToken.get_all_tokens_by_user_id(targetID)
for token in target_tokens:
Expand Down