mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
Remove RichEmbed in favour of MessageEmbed (#1584)
* remove RichEmbed in favour of MessageEmbed * fix provider typo
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
const Util = require('../../util/Util');
|
||||
const Embed = require('../MessageEmbed');
|
||||
const { RangeError } = require('../../errors');
|
||||
|
||||
module.exports = function sendMessage(channel, options) {
|
||||
module.exports = function sendMessage(channel, options) { // eslint-disable-line complexity
|
||||
const User = require('../User');
|
||||
const GuildMember = require('../GuildMember');
|
||||
if (channel instanceof User || channel instanceof GuildMember) return channel.createDM().then(dm => dm.send(options));
|
||||
let { content, nonce, reply, code, disableEveryone, tts, embed, files, split } = options;
|
||||
|
||||
if (embed) embed = new Embed(embed)._apiTransform();
|
||||
|
||||
if (typeof nonce !== 'undefined') {
|
||||
nonce = parseInt(nonce);
|
||||
if (isNaN(nonce) || nonce < 0) throw new RangeError('MESSAGE_NONCE_TYPE');
|
||||
|
||||
Reference in New Issue
Block a user