diff --git a/src/structures/shared/SendMessage.js b/src/structures/shared/SendMessage.js index 3eacb1b57..48212295a 100644 --- a/src/structures/shared/SendMessage.js +++ b/src/structures/shared/SendMessage.js @@ -15,6 +15,14 @@ module.exports = function sendMessage(channel, options) { // eslint-disable-line if (isNaN(nonce) || nonce < 0) throw new RangeError('MESSAGE_NONCE_TYPE'); } + // Add the reply prefix + if (reply && !(channel instanceof User || channel instanceof GuildMember) && channel.type !== 'dm') { + const id = channel.client.resolver.resolveUserID(reply); + const mention = `<@${reply instanceof GuildMember && reply.nickname ? '!' : ''}${id}>`; + if (split) split.prepend = `${mention}, ${split.prepend || ''}`; + content = `${mention}${typeof content !== 'undefined' ? `, ${content}` : ''}`; + } + if (content) { content = Util.resolveString(content); if (split && typeof split !== 'object') split = {}; @@ -36,14 +44,6 @@ module.exports = function sendMessage(channel, options) { // eslint-disable-line if (split) content = Util.splitMessage(content, split); } - // Add the reply prefix - if (reply && !(channel instanceof User || channel instanceof GuildMember) && channel.type !== 'dm') { - const id = channel.client.resolver.resolveUserID(reply); - const mention = `<@${reply instanceof GuildMember && reply.nickname ? '!' : ''}${id}>`; - if (split) split.prepend = `${mention}, ${split.prepend || ''}`; - content = `${mention}${typeof content !== 'undefined' ? `, ${content}` : ''}`; - } - if (content instanceof Array) { return new Promise((resolve, reject) => { const messages = [];