mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +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}
|
* @returns {MessageOptions|WebhookMessageOptions}
|
||||||
*/
|
*/
|
||||||
static create(target, options, extra = {}) {
|
static create(target, options, extra = {}) {
|
||||||
if (typeof options === 'string') return new this(target, { content: options, ...extra });
|
return new this(
|
||||||
else return new this(target, { ...options, ...extra });
|
target,
|
||||||
|
typeof options !== 'object' || options === null ? { content: options, ...extra } : { ...options, ...extra },
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user