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:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user