mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
fix(ApiMessage): only pass objects as options directly (#5793)
* fix(ApiMessage): only pass objects as options directly * refactor: inline if with ternary
This commit is contained in:
@@ -320,8 +320,10 @@ class APIMessage {
|
||||
* @returns {MessageOptions|WebhookMessageOptions}
|
||||
*/
|
||||
static create(target, options, extra = {}) {
|
||||
if (typeof options === 'string') return new this(target, { content: options, ...extra });
|
||||
else return new this(target, { ...options, ...extra });
|
||||
return new this(
|
||||
target,
|
||||
typeof options !== 'object' || options === null ? { content: options, ...extra } : { ...options, ...extra },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user