- 
                Notifications
    
You must be signed in to change notification settings  - Fork 0
 
Open
Labels
enhancementNew feature or requestNew feature or requestgood for newcomersGood for newcomersGood for newcomers
Description
As a developer, I want to properly type Discord interactions so that we don’t rely on @ts-ignore and can catch type errors at compile time.
🧠 Context
Currently, we are using @ts-ignore in multiple places when accessing properties from Discord interactions. This is a temporary workaround to avoid TypeScript errors, but it bypasses static type checking and can lead to runtime issues.
Examples of this can be found in:
src/infrastructure/discord/commands/unassignedIssues.tssrc/infrastructure/discord/commands/myIssues.ts
For instance:
🛠️ Implementation Plan
- 
Identify All
@ts-ignoreUsages- Scan the codebase for all usages of 
@ts-ignorerelated to Discordinteractiondata access - Focus on the two known files, but check others for consistency
 
 - Scan the codebase for all usages of 
 - 
Correctly Type Interactions
- Use the correct types from 
discord.js(e.g.,ChatInputCommandInteraction) - Narrow interaction types using type guards where necessary (e.g., checking 
.isChatInputCommand()before accessing.options) 
Example:
if (interaction.isChatInputCommand()) { const username = interaction.options.getString("username"); // Use with confidence now }
 - Use the correct types from 
 - 
Remove All
@ts-ignoreStatements- After correcting the types, remove the corresponding 
@ts-ignorecomments 
 - After correcting the types, remove the corresponding 
 - 
Add Type-Safe Wrappers or Helpers (Optional)
- If access patterns repeat frequently, consider writing typed utility functions for common operations like 
.options.getString(...) 
 - If access patterns repeat frequently, consider writing typed utility functions for common operations like 
 - 
Verify with Lint + Type Check
- Run 
tscand your linter to ensure no errors remain 
 - Run 
 
✅ Acceptance Criteria
-  All 
@ts-ignorestatements related to Discord interactions are removed from the codebase -  
interactionobjects are correctly typed usingdiscord.jstypes -  Commands in 
unassignedIssues.tsandmyIssues.tsaccess interaction data safely without type suppression - TypeScript compiles without error, and ESLint reports no type-ignorant code
 - Optional: Utility functions are introduced if repetitive interaction access patterns are observed
 
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood for newcomersGood for newcomersGood for newcomers
Type
Projects
Status
Ready
