Skip to content

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
unterrunden:patch-1
Draft

Shifted around (un)banning / kicking logic; removed user permissions upon banning; default ban duration; very wip temporary ban option#84
unterrunden wants to merge 9 commits intoaphased:mainfrom
unterrunden:patch-1

Conversation

@unterrunden
Copy link
Copy Markdown

@unterrunden unterrunden commented Jun 9, 2025

  • 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 duration argument is provided) to 30 days

  • additional 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?)

- 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
@unterrunden unterrunden changed the title Update Ban.mjs Update Ban.mjs, Unban.mjs, Kick.mjs Jun 10, 2025
@unterrunden unterrunden changed the title Update Ban.mjs, Unban.mjs, Kick.mjs Update Ban.mjs, Unban.mjs, Kick.mjs, Mute.mjs Jun 10, 2025
temporary ban option
temporary ban option
temporary ban option
temporary ban option
@unterrunden unterrunden changed the title Update Ban.mjs, Unban.mjs, Kick.mjs, Mute.mjs Shifted around (un)banning / kicking logic; removed user permissions upon banning; default ban duration; very wip temporary ban option Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant