-
-
Notifications
You must be signed in to change notification settings - Fork 39
[LevelUp] Extend external API and add dynamic command cooldown and unlocking based on level #231
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
base: main
Are you sure you want to change the base?
Conversation
Please contact me in the 3rd party server to discuss this |
Merge from fork
…guild owners to set channels to ignore level up notifications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR extends the external API for user profiles and introduces dynamic level-based command cooldowns and unlocking.
- Added get_xp and get_level methods to retrieve user XP and level.
- Implemented new level and cooldown checks via a dedicated Checks class and integrated them into the bot's hook system.
- Introduced a set of admin and user commands for managing command cooldowns, level requirements, and notification preferences.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
levelup/shared/profile.py | Added get_xp and get_level methods for retrieving user XP and level. |
levelup/shared/levelups.py | Updated notification logic to respect user notification preferences. |
levelup/shared/checks.py | Introduced new Checks class for level and cooldown validations. |
levelup/shared/init.py | Integrated Checks into SharedFunctions. |
levelup/main.py | Registered and unregistered before_invoke hooks for new checks. |
levelup/common/models.py | Added new configuration fields for command cooldowns and bypass roles. |
levelup/commands/user.py | Added a toggle command for level up notifications and revised prestige logic. |
levelup/commands/admin.py | Added commands for managing bypass members/roles, level cooldowns, and requirements. |
levelup/README.md | Updated documentation with instructions for new commands and features. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Hey, I took a look through the PR and it seems good, could you bump the minor version number since this is a big change? Its under the main cog constructor class. |
Done |
I extended the functionality of the shared functions for user profiles, allowing external cogs to get xp and level of users. I also added a new system to LevelUp that allows guild owners to setup dynamic command lock/unlock based on their level, as well as cooldowns for any command based on level. This is done by creating hooks and injecting them into RedBot that will check user's level and send appropriate error messages if they do not meet the level requirement for a command, or are on cooldown for a command based on their level.