SLA compatibility with admin only utility command and access#46
Merged
warengonzaga merged 8 commits intodevfrom Jul 8, 2025
Merged
SLA compatibility with admin only utility command and access#46warengonzaga merged 8 commits intodevfrom
warengonzaga merged 8 commits intodevfrom
Conversation
Member
Author
Contributor
There was a problem hiding this comment.
Pull Request Overview
Enforces admin-only group configuration for support tickets by introducing a /setup command, a setup wizard, and environment validation for admin users.
- Added permission utilities (
validateAdminAccess,hasAdminAccess,requireAdminAccess) and bot-admin checks with retry prompts - Extended
getOrCreateCustomerto block ticket creation in unconfigured groups and surface a clear error - Implemented
GroupConfigandSetupStatestorage inBotsStore, new setup flow in commands, and updated docs forADMIN_USERS
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/permissions.ts | Admin-access validation and decorators |
| src/utils/botPermissions.ts | Bot-admin status checks, prompts, and callback handling |
| src/services/unthread.ts | getOrCreateCustomer now enforces setup and throws on unconfigured |
| src/sdk/types.ts | New GroupConfig and SetupState interfaces |
| src/sdk/bots-brain/BotsStore.ts | CRUD operations for group config and setup state |
| src/index.ts | Registered setup command |
| src/events/message.ts | Integrated setup text input before support flow |
| src/config/env.ts | Added ADMIN_USERS parsing and placeholder validation |
| src/commands/index.ts | Full /setup command implementation and wizard callbacks |
| README.md, .env.railway, .env.example | Documentation updates for ADMIN_USERS and Redis URLs |
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.
This PR implements a comprehensive group setup and admin control system for the Unthread Telegram Bot, ensuring robust environment validation, admin-only commands, and role-based access control. The implementation includes strict enforcement of required environment variables, improved logging, batch operations for better performance, and enhanced user experience for both developers and end-users.