feat(MessageEmbed): remove normalizeField validation (#5459)

This commit is contained in:
anandre
2021-05-11 15:24:35 -05:00
committed by GitHub
parent d219ecd05c
commit ff2f7372f2
2 changed files with 0 additions and 6 deletions

View File

@@ -37,9 +37,6 @@ const Messages = {
COLOR_RANGE: 'Color must be within the range 0 - 16777215 (0xFFFFFF).',
COLOR_CONVERT: 'Unable to convert color to a number.',
EMBED_FIELD_NAME: 'MessageEmbed field names may not be empty.',
EMBED_FIELD_VALUE: 'MessageEmbed field values may not be empty.',
FILE_NOT_FOUND: file => `File could not be found: ${file}`,
USER_NO_DMCHANNEL: 'No DM Channel exists!',

View File

@@ -1,6 +1,5 @@
'use strict';
const { RangeError } = require('../errors');
const Util = require('../util/Util');
/**
@@ -445,9 +444,7 @@ class MessageEmbed {
*/
static normalizeField(name, value, inline = false) {
name = Util.resolveString(name);
if (!name) throw new RangeError('EMBED_FIELD_NAME');
value = Util.resolveString(value);
if (!value) throw new RangeError('EMBED_FIELD_VALUE');
return { name, value, inline };
}