Skip to content

Commit

Permalink
fix: TS v5.5 breaks build (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
ExampleWasTaken authored Nov 9, 2024
1 parent 4b6c9fe commit 266660e
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 71 deletions.
5 changes: 5 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changelog


Update <small>_ November 2024</small>

- fix: TS v5.5 breaks build (09/11/2024)

Update <small>_ October 2024</small>

- fix: Changing A32NX Releases to Aircraft Releases in Role assignment (30/10/2024)
Expand Down
171 changes: 104 additions & 67 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"bad-words": "^3.0.4",
"cache-manager": "^5.7.6",
"config": "^3.3.9",
"discord.js": "^14.11.0",
"discord.js": "^14.16.1",
"jsdom": "^23.2.0",
"moment": "^2.29.4",
"mongoose": "^8.0.3",
Expand All @@ -42,7 +42,7 @@
"eslint": "^7.29.0",
"nodemon": "^3.0.2",
"ts-node": "^10.4.0",
"typescript": "~5.4.5"
"typescript": "^5.5.4"
},
"engines": {
"node": "18.x"
Expand Down
7 changes: 5 additions & 2 deletions src/events/buttonHandlers/buttonHandler.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ButtonComponent } from 'discord.js';
import { event, Events } from '../../lib';
import { handleRoleAssignment } from './functions/handleRoleAssignment';

Expand All @@ -6,9 +7,11 @@ export default event(Events.InteractionCreate, async ({ log }, interaction) => {

log('Button Handler: Button pressed');

const { customId, component, user } = interaction;
// needed as TS cannot infer the type of component from the destructure assignment
const component = interaction.component as ButtonComponent;
const { customId, user } = interaction;

const buttonLabel = component?.label;
const buttonLabel = component.label;

try {
const [prefix, ...params] = interaction.customId.split('_');
Expand Down

0 comments on commit 266660e

Please sign in to comment.