Shifted around (un)banning / kicking logic; removed user permissions upon banning; default ban duration; very wip temporary ban option#84
Draft
unterrunden wants to merge 9 commits intoaphased:mainfrom
Conversation
- reworked order of banning: /lobby -> /block add -> /p kick (switching around last 2) - added a statement that checks if the inputted user exists (previously only found in Unban.mjs) - extended "you cannot ban someone with higher a permission level" in that it includes your and the target player's permission and level - upon banning, sets permission level of affected user to 0 and logs that to the console
- added an if-else if statement for differentiating whether sender perms are the same as the target user's perms or 'undefined' (aka user doesn't exist in database and can therefore not ban), instead of just "is target user's perm level higher?" - added missing bracket in "you cannot ban a player of higher ..."
- updated to be more in-line with Ban.mjs and Unban.mjs
- added ${player} to the "player not found" chat
- added "you cannot kick someone with higher a permission level" (previously just a `return`) including your and the target player's permissions and level
- changed let reason into a const
- added `/lobby` before executing `/kick` similar to the (un)banning command logic
temporary ban option
temporary ban option
temporary ban option
temporary ban option
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
reworked some of the logic of the commands to be consistent with one another
order of the banning process was changed
added ${player} to the "player not found" chat for all commands
extended "you cannot ban / unban / kick someone with higher a permission level" in that it includes your and the target player's permission and level
upon banning, sets permission level of affected user to 0 and logs that to the console
added default duration for a ban (if no
durationargument is provided) to 30 daysadditional dialog when attempting to (un)ban a user that's already (un)banned
attempt at a temporary ban feature with a banRegistry class in Utils.mjs, a setInterval function refreshing every 60 seconds and a dictionary storing the usernames along with ban start and end times (what am i doing?)