Implement command cooldown management and enhance command execution flow

- Introduced `applyCommandCooldown` function to manage per-command cooldowns after execution, improving command rate limiting.
- Updated command execution flow to include cooldown application, ensuring users are informed of cooldown status.
- Enhanced error handling in interaction replies, allowing for more graceful error management and user feedback.
- Improved the handling of interaction responses across various commands, ensuring consistent user experience.
- Added permission checks for new commands, ensuring only authorized users can execute specific actions.
This commit is contained in:
TheOnlyMace
2026-07-25 15:37:56 +02:00
parent 57cdf847f5
commit 8513848440
42 changed files with 856 additions and 160 deletions

View File

@@ -32,11 +32,16 @@ export async function isOwnerUser(userId: string): Promise<boolean> {
}
/**
* Owner-panel team members (any role) may open every guild where the bot is
* Owner-panel team members with SUPPORT+ may open every guild where the bot is
* installed — for support without needing Manage Guild on Discord.
* VIEWER is owner-panel read-only and does not bypass guild dashboard APIs.
*/
export async function hasOwnerGuildBypass(userId: string): Promise<boolean> {
return (await resolveOwnerRole(userId)) !== null;
const role = await resolveOwnerRole(userId);
if (!role) {
return false;
}
return ownerRoleAtLeast(role, 'SUPPORT');
}
export async function requireOwner(minimum: OwnerRole = 'VIEWER'): Promise<OwnerSession> {