Skip to content

Commit 0389687

Browse files
authored
Merge pull request #231 from brandons209/main
[LevelUp] Extend external API and add dynamic command cooldown and unlocking based on level
2 parents d6aa2ab + ad7269a commit 0389687

File tree

9 files changed

+583
-39
lines changed

9 files changed

+583
-39
lines changed

levelup/README.md

Lines changed: 164 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ View User Profile<br/>
9797
- Aliases: `pf`
9898
- Cooldown: `3 per 10.0 seconds`
9999
- Checks: `server_only`
100+
# [p]lvlupnotify (Hybrid Command)
101+
Toggles level up notifications for a user
102+
- Usage: `[p]lvlupnotify`
103+
- Slash Usage: `/lvlupnotify`
104+
- Aliases: `notify`
105+
- Checks: `server_only`
100106
# [p]prestige (Hybrid Command)
101107
Prestige your rank!<br/>
102108
Once you have reached this servers prestige level requirement, you can<br/>
@@ -543,17 +549,98 @@ Add a role to a prestige level<br/>
543549
### [p]levelset prestige stack
544550
Toggle stacking roles on prestige<br/>
545551

546-
For example each time you prestige, you keep the previous prestige roles<br/>
547-
- Usage: `[p]levelset prestige stack`
548-
### [p]levelset prestige level
549-
Set the level required to prestige<br/>
550-
- Usage: `[p]levelset prestige level <level>`
551-
## [p]levelset ignore
552-
Base command for all ignore lists<br/>
553-
- Usage: `[p]levelset ignore`
554-
### [p]levelset ignore role
555-
Add/Remove a role in the ignore list<br/>
556-
Members with roles in the ignore list don't gain XP<br/>
552+
**If using dmrole or msgrole**<br/>
553+
`{role}`: The role the user just recieved<br/>
554+
- Usage: `[p]levelset levelupmessages`
555+
- Aliases: `lvlalerts, levelalerts, lvlmessages, and lvlmsg`
556+
### [p]levelset levelupmessages msgrole
557+
Set the message sent when a user levels up and recieves a role.<br/>
558+
559+
**Arguments**<br/>
560+
The following placeholders can be used:<br/>
561+
`{username}`: The user's name<br/>
562+
`{mention}`: Mentions the user<br/>
563+
`{displayname}`: The user's display name<br/>
564+
`{level}`: The level the user just reached<br/>
565+
`{server}`: The server the user is in<br/>
566+
`{role}`: The role the user just recieved<br/>
567+
- Usage: `[p]levelset levelupmessages msgrole [message]`
568+
### [p]levelset levelupmessages msg
569+
Set the message sent when a user levels up.<br/>
570+
571+
**Arguments**<br/>
572+
The following placeholders can be used:<br/>
573+
`{username}`: The user's name<br/>
574+
`{mention}`: Mentions the user<br/>
575+
`{displayname}`: The user's display name<br/>
576+
`{level}`: The level the user just reached<br/>
577+
`{server}`: The server the user is in<br/>
578+
- Usage: `[p]levelset levelupmessages msg [message]`
579+
### [p]levelset levelupmessages dmrole
580+
Set the DM a user gets when they level up and recieve a role.<br/>
581+
582+
**Arguments**<br/>
583+
The following placeholders can be used:<br/>
584+
`{username}`: The user's name<br/>
585+
`{mention}`: Mentions the user<br/>
586+
`{displayname}`: The user's display name<br/>
587+
`{level}`: The level the user just reached<br/>
588+
`{server}`: The server the user is in<br/>
589+
`{role}`: The role the user just recieved<br/>
590+
- Usage: `[p]levelset levelupmessages dmrole [message]`
591+
### [p]levelset levelupmessages dm
592+
Set the DM a user gets when they level up (Without recieving a role).<br/>
593+
594+
**Arguments**<br/>
595+
The following placeholders can be used:<br/>
596+
`{username}`: The user's name<br/>
597+
`{mention}`: Mentions the user<br/>
598+
`{displayname}`: The user's display name<br/>
599+
`{level}`: The level the user just reached<br/>
600+
`{server}`: The server the user is in<br/>
601+
- Usage: `[p]levelset levelupmessages dm [message]`
602+
### [p]levelset levelupmessages view
603+
View the current level up alert messages<br/>
604+
- Usage: `[p]levelset levelupmessages view`
605+
## [p]levelset lvlreq
606+
Manage level requirement for commands
607+
### [p]levelset lvlreq add
608+
Add a level requirement to the command
609+
- Usage: `[p]levelset lvlreq add <level> <command>`
610+
### [p]levelset lvlreq del
611+
Remove a level requirement for a command
612+
- Usage: `[p]levelset lvlreq del <command>`
613+
### [p]levelset lvlreq list
614+
List all commands and their level requirements
615+
- Usage: `[p]levelset lvlreq list`
616+
## [p]levelset cooldowns
617+
Manage per level command cooldowns
618+
### [p]levelset cooldowns add
619+
Add a cooldown for a command based on level
620+
Multiple cooldown levels can be set, the cooldown will be applied to members at the specified level and under
621+
Warning: This will override any default cooldowns for the command
622+
623+
Example:
624+
[p]lset cooldowns add 5 15 mycommand
625+
[p]lset cooldowns add 10 5 mycommand
626+
Members who are level [0, 5] will have a cooldown of 15 seconds for mycommand (including members at level 5)
627+
Members who are level (5, 10] will have a cooldown of 5 seconds (level 6 to level 10)
628+
Members above level 10 will have no cooldown
629+
- Usage: `[p]levelset cooldowns add <level> <cooldown> <command>`
630+
### [p]levelset cooldowns del
631+
Remove a level cooldown for a command
632+
- Usage: `[p]levelset cooldowns del <level> <command>`
633+
### [p]levelset cooldowns list
634+
List all commands and their cooldowns per level
635+
- Usage: `[p]levelset cooldowns list`
636+
## [p]levelset view
637+
View all LevelUP settings<br/>
638+
- Usage: `[p]levelset view`
639+
## [p]levelset addxp
640+
Add XP to a user or role<br/>
641+
- Usage: `[p]levelset addxp <user_or_role> <xp>`
642+
## [p]levelset setlevel
643+
Set a user's level<br/>
557644

558645
Use the command with a role already in the ignore list to remove it<br/>
559646
- Usage: `[p]levelset ignore role <role>`
@@ -634,11 +721,72 @@ Cooldown threshold for message XP<br/>
634721
When a user sends a message they will have to wait X seconds before their message<br/>
635722
counts as XP gained<br/>
636723
- Usage: `[p]levelset messages cooldown <cooldown>`
637-
## [p]levelset roles
638-
Level role assignment<br/>
639-
- Usage: `[p]levelset roles`
640-
### [p]levelset roles initialize
641-
Initialize level roles<br/>
724+
## [p]levelset rolegroup
725+
Add or remove a role to the role group<br/>
726+
727+
These roles gain their own experience points as a group<br/>
728+
When a member gains xp while having this role, the xp they earn is also added to the role group<br/>
729+
- Usage: `[p]levelset rolegroup <role>`
730+
## [p]levelset levelnotify
731+
Send levelup message in the channel the user is typing in<br/>
732+
733+
Send a message in the channel a user is typing in when they level up<br/>
734+
- Usage: `[p]levelset levelnotify`
735+
## [p]levelset commandxp
736+
Toggle whether users can gain Exp from running commands<br/>
737+
- Usage: `[p]levelset commandxp`
738+
## [p]levelset allowed
739+
Base command for all allowed lists<br/>
740+
- Usage: `[p]levelset allowed`
741+
### [p]levelset allowed role
742+
Add/Remove a role in the allowed list<br/>
743+
If the allow list is not empty, only roles in the list will gain XP<br/>
744+
745+
Use the command with a role already in the allowed list to remove it<br/>
746+
- Usage: `[p]levelset allowed role <role>`
747+
### [p]levelset allowed channel
748+
Add/Remove a channel in the allowed list<br/>
749+
If the allow list is not empty, only channels in the list will gain XP<br/>
750+
751+
Use the command with a channel already in the allowed list to remove it<br/>
752+
- Usage: `[p]levelset allowed channel <channel>`
753+
## [p]levelset dm
754+
Toggle DM notifications<br/>
755+
756+
Determines whether LevelUp messages are DM'd to the user<br/>
757+
- Usage: `[p]levelset dm`
758+
## [p]levelset starmention
759+
Toggle star reaction mentions<br/>
760+
Toggle whether the bot mentions that a user reacted to a message with a star<br/>
761+
- Usage: `[p]levelset starmention`
762+
## [p]levelset seelevels
763+
Test the level algorithm<br/>
764+
View the first 20 levels using the current algorithm to test experience curve<br/>
765+
- Usage: `[p]levelset seelevels`
766+
## [p]levelset ignore
767+
Base command for all ignore lists<br/>
768+
- Usage: `[p]levelset ignore`
769+
### [p]levelset ignore channel
770+
Add/Remove a channel in the ignore list<br/>
771+
Channels in the ignore list don't gain XP<br/>
772+
773+
Use the command with a channel already in the ignore list to remove it<br/>
774+
- Usage: `[p]levelset ignore channel <channel>`
775+
### [p]levelset ignore notify
776+
Add/Remove a channel in the notify ignore list<br/>
777+
Channels in the notify ignore list will have level up notifications suppressed<br/>
778+
779+
Use the command with a channel already in the notify ignore list to remove it<br/>
780+
- Usage: `[p]levelset ignore notify <channel>`
781+
### [p]levelset ignore role
782+
Add/Remove a role in the ignore list<br/>
783+
Members with roles in the ignore list don't gain XP<br/>
784+
785+
Use the command with a role already in the ignore list to remove it<br/>
786+
- Usage: `[p]levelset ignore role <role>`
787+
### [p]levelset ignore user
788+
Add/Remove a user in the ignore list<br/>
789+
Members in the ignore list don't gain XP<br/>
642790

643791
This command is for if you added level roles after users have achieved that level,<br/>
644792
it will apply all necessary roles to a user according to their level and prestige<br/>

0 commit comments

Comments
 (0)