-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
bug: Error when getting output type of "require('discord.js')" #547
Comments
This is not the intended use case of this package. It's supposed to be used on a variable, not on a module. That said it is odd. We can look into it. |
yeah, I just made a bug report because if it happens on something like this it may error in certain circumstances. So I did a test and these are the modules that it errors on when trying to read them. [
[ 'SlashCommandBuilder', [Function: SlashCommandBuilder] ],
[
'SlashCommandChannelOption',
[Function: SlashCommandChannelOption]
],
[
'SlashCommandIntegerOption',
[Function: SlashCommandIntegerOption]
],
[ 'SlashCommandNumberOption', [Function: SlashCommandNumberOption] ],
[ 'SlashCommandStringOption', [Function: SlashCommandStringOption] ],
[
'SlashCommandSubcommandBuilder',
[Function: SlashCommandSubcommandBuilder]
],
[
'SlashCommandSubcommandGroupBuilder',
[Function: SlashCommandSubcommandGroupBuilder]
]
] Found by doing const { Type } = require('@sapphire/type');
const results = [];
const errors = [];
for (const [key, value] of Object.entries(require('discord.js'))) {
try {
results.push(new Type(value));
} catch (error) {
results.push(error);
errors.push([key, value])
}
}
console.log(errors); |
Released in v2.5.1 |
Is there an existing issue for this?
Description of the bug
Only seems to happen when requiring discord.js and evaluating the output of it using the Type class. So I doubt you would want to fix it. Just thought I'd make a bug report just in case.
Example code includes
Will cause the error.
Steps To Reproduce
Expected behavior
Wasn't expected to error.
Screenshots
Additional context
No response
System Info
The text was updated successfully, but these errors were encountered: