Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Fixed issue: Class with commands no longer needs to be the first export #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

charged-ion
Copy link

If a user creates a file containing commands that is being imported through @discord import, the very first export of the file had to be the class containing all of the commands. If the first export was something else, in example a string, a run time error will occur and the process will exit. The error returned is "Uncaught TypeError: classType is not a constructor".

This fix will allow users to be able to export constant values regardless of the location of the file without affecting the intended use of the class containing all of the commands.

@Adondriel
Copy link
Contributor

what node version does the new p?.prototype?.constructor syntax require?

@charged-ion
Copy link
Author

what node version does the new p?.prototype?.constructor syntax require?

It's not the node version, but rather Typescript version 3.7.

Context:
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#optional-chaining

@owengombas owengombas added the v4 Issue related to v4 (@Command) label Jun 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
v4 Issue related to v4 (@Command)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants