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(ApiMessage): only pass objects as options directly #5793

Merged
merged 2 commits into from Jun 10, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/structures/APIMessage.js
Expand Up @@ -320,7 +320,7 @@ class APIMessage {
* @returns {MessageOptions|WebhookMessageOptions}
*/
static create(target, options, extra = {}) {
if (typeof options === 'string') return new this(target, { content: options, ...extra });
if (typeof options !== 'object' || options === null) return new this(target, { content: options, ...extra });
else return new this(target, { ...options, ...extra });
ckohen marked this conversation as resolved.
Show resolved Hide resolved
}
}
Expand Down