-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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 Util#splitMessage when destructured #3456
Conversation
resolveString should be called as `Util.resolveString` since it's a static method.
|
I have to note, though, your reason for the fix is incorrect. The method works fine with What breaks this is when you destructure the method, as in: const { util: { splitMessage } } = require('discord.js');
splitMessage('');
// TypeError: Cannot read property 'resolveString' of undefined But if you do not destructure the method itself, it will work just fine: const { util } = require('discord.js');
util.splitMessage('');
// [ '' ] That's because when destructuring the method, you're removing it's context, used for the |
This reverts commit ebb4c6c.
Please describe the changes this PR makes and why it should be merged:
this PR fixes the
Utils#splitMessage
method because resolveString should be called asUtil.resolveString
since it's a static method.Update
kyranet posted a better reason why this PR should be merged here.
Status
Semantic versioning classification: