mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
feat(MessageEmbed): remove normalizeField validation (#5459)
This commit is contained in:
@@ -37,9 +37,6 @@ const Messages = {
|
|||||||
COLOR_RANGE: 'Color must be within the range 0 - 16777215 (0xFFFFFF).',
|
COLOR_RANGE: 'Color must be within the range 0 - 16777215 (0xFFFFFF).',
|
||||||
COLOR_CONVERT: 'Unable to convert color to a number.',
|
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}`,
|
FILE_NOT_FOUND: file => `File could not be found: ${file}`,
|
||||||
|
|
||||||
USER_NO_DMCHANNEL: 'No DM Channel exists!',
|
USER_NO_DMCHANNEL: 'No DM Channel exists!',
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { RangeError } = require('../errors');
|
|
||||||
const Util = require('../util/Util');
|
const Util = require('../util/Util');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -445,9 +444,7 @@ class MessageEmbed {
|
|||||||
*/
|
*/
|
||||||
static normalizeField(name, value, inline = false) {
|
static normalizeField(name, value, inline = false) {
|
||||||
name = Util.resolveString(name);
|
name = Util.resolveString(name);
|
||||||
if (!name) throw new RangeError('EMBED_FIELD_NAME');
|
|
||||||
value = Util.resolveString(value);
|
value = Util.resolveString(value);
|
||||||
if (!value) throw new RangeError('EMBED_FIELD_VALUE');
|
|
||||||
return { name, value, inline };
|
return { name, value, inline };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user