generated from nhcarrigan/template
feat: add slash commands and context menu command (#16)
## Summary This PR adds a suite of slash commands and a context menu command to Amari, along with shared utilities and quality improvements across the board. ### New Commands - **`/create-issue`** — generates a GitHub issue on a specified repo using AI-drafted content (title, description, acceptance criteria) - **`/create-task`** — creates a task in Naomi's Leantime instance with an AI-drafted description and configurable priority - **`/onboard-mentee`** — automates the mentorship onboarding flow (GitHub invite, forum thread, role assignment) - **Forward to Owner** (context menu, message command) — forwards any message to Naomi with action buttons (contributed by @teklu) ### Shared Utilities - **`src/utils/makeAiRequest.ts`** — a single wrapper around the Anthropic SDK for all AI calls, with Amari's personality prompt baked in and full error handling - **`src/events/handleInteractionCreate.ts`** — extracted interaction handler (was inline in `index.ts`) to keep complexity under control ### Quality Improvements - `ephemeral: true` → `flags: [ MessageFlags.Ephemeral ]` (deprecated API removed) - Full `try/catch` + `logger.error` audit across all modules (`logMenteeJoin`, `checkAchievements`, `processMentorshipRole`, `processGitHubEvent`) - `deployGlobal.ts` replaced with a static `commands.json` payload for manual registration - Amari's personality prompt updated to reflect her actual character — warm, observant, and relentlessly caring ### Notes - `CLIENT_ID` is needed in 1Password at `op://Environment Variables - Naomi/Amari/client id` for the `commands.json` registration call - The forward-to-owner command (PR #13, contributed by @teklu) is fully preserved with original commit authorship ✨ This PR was created with help from Hikari~ 🌸 Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com> Co-authored-by: Teklu <tekluabayneh@gmail.com> Reviewed-on: #16 Co-authored-by: Hikari <hikari@nhcarrigan.com> Co-committed-by: Hikari <hikari@nhcarrigan.com>
This commit was merged in pull request #16.
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
[
|
||||
{
|
||||
"name": "create-issue",
|
||||
"type": 1,
|
||||
"description": "Creates a Gitea issue with an AI-generated body.",
|
||||
"options": [
|
||||
{
|
||||
"name": "owner",
|
||||
"description": "The owner of the repository.",
|
||||
"type": 3,
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "repo",
|
||||
"description": "The name of the repository.",
|
||||
"type": 3,
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"description": "The issue title.",
|
||||
"type": 3,
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"description": "Optional additional context for the issue body.",
|
||||
"type": 3,
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "create-task",
|
||||
"type": 1,
|
||||
"description": "Creates a Leantime task with an AI-generated description.",
|
||||
"options": [
|
||||
{
|
||||
"name": "title",
|
||||
"description": "The task title.",
|
||||
"type": 3,
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"description": "Optional additional context for the task description.",
|
||||
"type": 3,
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "priority",
|
||||
"description": "The task priority level (1-5, default 3).",
|
||||
"type": 4,
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "onboard-mentee",
|
||||
"type": 1,
|
||||
"description": "Onboards a new mentee by setting up their GitHub repository.",
|
||||
"options": [
|
||||
{
|
||||
"name": "mentee_name",
|
||||
"description": "The mentee's full name.",
|
||||
"type": 3,
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "github_username",
|
||||
"description": "The mentee's GitHub username.",
|
||||
"type": 3,
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "mentee",
|
||||
"description": "The mentee's Discord account.",
|
||||
"type": 6,
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Forward to Naomi",
|
||||
"type": 3
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user