Repository navigation
Conversation
Make permission checking mode-aware and group missing perms by location. - Adjust server-wide permission list to depend on settings.UseThreads to avoid reporting irrelevant missing permissions. Append standard permissions after mode-specific ones. - In panel permission checks, treat a panel as using threads if either global settings or the panel enable threads. Use logic.ThreadPermissions for thread-mode channel checks and simplify assembled permission slices. - Add ThreadPermissions constant in bot/logic/discordpermissions.go for reuse. - Rewrite findMissingPermissions to return labeled missing-permission groups (panel channel, notification channel, transcript channel) instead of a flat list; check primary channel, optional notification channel (thread mode), and transcript channel, using channel-level and guild-level checks as appropriate. - Update reply formatting to render missing permissions grouped by location with a title and footer linking docs. These changes reduce false positives, centralize thread-mode permissions, and provide clearer error messages to users about where permissions are missing.
Replace local permission constants/usages with the centralized github.com/TicketsBot-cloud/common/botpermissions package across the codebase. Updated imports and calls to BuildPermissions to use botpermissions.StandardPermissions, MinimalPermissions, ThreadModeRequired, NotifChannelRequired, TranscriptChannelRequired, and ChannelModeRequired where appropriate. Removed duplicate permission arrays from bot/logic/discordpermissions.go and adjusted code to copy/append permission slices safely. Also enabled a local replace for the common module in go.mod. This centralizes permission definitions and reduces duplication.
Replace manual permission aggregation with botpermissions.EffectivePermissions and consolidate data fetching into fetchGuildData/fetchChannelData/buildRoleMap helpers. Simplifies HasPermissions/HasPermissionsChannel and GetMissingPermissions* by delegating to centralized logic, removes many in-file permission helpers, and updates imports accordingly. Keeps existing error handling (sentry) and preserves administrator short-circuit behavior.
Uncomment the replace directive for github.com/TicketsBot-cloud/common in go.mod to point to the local ../common module. This allows building and testing against the local copy of the common package during development; other replace directives remain unchanged.
BenHall-1
previously approved these changes
Apr 26, 2026
Member
|
@biast12 good to bump when you are |
Contributor
Author
|
bumped! |
BenHall-1
previously approved these changes
Jun 21, 2026
Update ticket claim and unclaim permission overwrites to use the shared botpermissions.StandardPermissions definition.
Capture fetchChannelData failures in Sentry before returning false from HasPermissionsChannel, improving visibility into permission-check failures.
Add channel permission validation for configured overflow categories, require EmbedLinks for transcript channels, and ensure channel-mode permissions are checked for panel-less opens.
Apply channel, thread, notification, pending-category, and transcript permissions consistently across admin diagnostics and command replies. Resolve panels from buttons, select menus, and modals, and replace the obsolete permission wrapper with shared bot permission requirements.
Adds admin-specific container builders without premium branding and updates admin commands and debug handlers to use them. Splits permission checks into separate containers and batches responses to stay within Discord component limits.
This PR is blocked
Remove the label(s) above once the underlying dependency bump or comment has landed, and this check will re-run on the next push. |
Contributor
Author
|
I made a mistake is the old common PR, so here is a fix for that: TicketsBot-cloud/common#12 |
Ensure permission diagnostics acknowledge interactions before sending follow-ups, split responses by component and text limits, and apply thread and pending-category permissions correctly. Also fix pin permission checks to use the ticket category.
Member
|
Good to bump @biast12 |
Use the latest published common module version and disable the local replacement so builds resolve the remote dependency.
Contributor
Author
|
@BenHall-1 bumped!! |
Wrap missing permission names in backticks in server-wide and channel permission diagnostics for clearer Markdown rendering.
Update missing-permission location detection to rely on the returned channel ID instead of the success flag, while ignoring the unused boolean result.
Use the channel type when displaying missing View Channel permissions in admin diagnostics and ticket opening errors. Also normalize botpermissions import ordering in related handlers.
Contributor
Author
|
fyi it doesn't need a common bump, it's on the latest one right now. Ben, you might have to bypass the required check |
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.
Description
Make permission checking mode-aware and group missing perms by location.
These changes reduce false positives, centralize thread-mode permissions, and provide clearer error messages to users about where permissions are missing.
Needs: TicketsBot-cloud/common#5 ✓
Type of Change
Testing
Checklist