Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: TS v5.5 breaks build #84

Merged
merged 6 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading