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

Defense channels and rolemapping #301

Merged
merged 17 commits into from
Jul 2, 2024
Merged

Defense channels and rolemapping #301

merged 17 commits into from
Jul 2, 2024

Commits on Mar 18, 2024

  1. Setup internal channel mapping

    ### Notes
    This adds an additional feature to the new audit channel flow. Once an `ext-name-audit` channel is setup, now you can make an `int-name-audit` channel, which will perform these steps:
    
    1. Setup a new role `Defense Internal: Name`
    2. Generate an invite for the `int-name-audit` channel
    3. Check if a matching `ext-name-audit` channel exists, if so assign `ViewChannel` permission to `Defense Internal: name` role.
    zuuring committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    035960f View commit details
    Browse the repository at this point in the history
  2. WIP Invite management

    This is still a work in progress just testing out the ability of assigning a role to an invite based of the uses it has.
    zuuring committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    4263db8 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2024

  1. Fix role mapping from invite

    Rewrite some of the checks and counts in-order to correctly match the role. The previous method was breaking on different format channels such as `ext-thesis-test-audit`
    zuuring committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    e001260 View commit details
    Browse the repository at this point in the history
  2. Move listInvites

    Moves `listInvites` into it's own function for easier calls
    zuuring committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    b7e2a64 View commit details
    Browse the repository at this point in the history
  3. Fix lint errors

    Refactor the `guildMemberAdd` event to resolve lint expression errors and make sure channel name is found correctly based on ext, int patterns
    zuuring committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    62015eb View commit details
    Browse the repository at this point in the history
  4. Fix role assignment issue

    Resolves the issue that would fail to assign internal roles to external channel if the channel name had the format `ext-client-name-audit` vs `ext-clientname-audit`
    zuuring committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    0fcf962 View commit details
    Browse the repository at this point in the history
  5. Resolve invite use count bug

    This fixes the bug happening on invites not counting correctly if they were being used more than 2 times on certain edge cases.
    zuuring committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    18eab22 View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2024

  1. WIP Add defense-audit command

    This is still WIP but adds the `defense-audit` command with the parameter `client-name` to automatically build `int-clientname-audit` and `ext-clientname-audit` channels with two roles `Defense Internal: ClientName` and `Defense External: ClientName`.
    
    Can only be run from the `defense` category
    zuuring committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    487162b View commit details
    Browse the repository at this point in the history
  2. Command restrictions

    This commit makes it so the `defense-audit` command can only be run within the `defense` parent category of channels and will send a reply if it isn't working as it should.
    
    Also adds an `interaction.editReply` inorder to avoid any timeout issues happening
    zuuring committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    0c3bd08 View commit details
    Browse the repository at this point in the history
  3. Remove debugging

    Removes the debug loggers from the scripts, not needed anymore!
    zuuring committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    971b6da View commit details
    Browse the repository at this point in the history
  4. Remove extra debugger

    zuuring committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    042c391 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2024

  1. Review updates / fixes

    This commit adds a number of changes to the audit channel flow. mainly:
    
    - Update permissions if channel already exists
    - Check if role already exists, if so skip
    - Changed logic so that if audit channels already exist, we output a different message to interaction
    - Remove embeds by wrapping invite URL in quotes.
    - Change verbiage around messages
    - Separates InternalChannel and externalChannel
    - Changed invite code permission match
    zuuring committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    982cbc5 View commit details
    Browse the repository at this point in the history
  2. Lint fix

    zuuring committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    62e5c89 View commit details
    Browse the repository at this point in the history
  3. Rename toaudit-name

    zuuring committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    71cd2f6 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2024

  1. Switch to objects

    This commit switches over from discordjs `Collection` in favour of storing invites as an object.
    zuuring committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    3eb7e8b View commit details
    Browse the repository at this point in the history
  2. Small fix

    zuuring committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    ec9974b View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. Add invite uses / expiry

    This commit does some refactoring based off review feedback (thank you!) as well as making sure the invite uses / expiry date is listed properly.
    zuuring committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    8bc32cb View commit details
    Browse the repository at this point in the history