File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const Util = require('../util/Util');
6
6
7
7
let deprecationEmittedForSetAuthor = false ;
8
8
let deprecationEmittedForSetFooter = false ;
9
+ let deprecationEmittedForAddField = false ;
9
10
10
11
// TODO: Remove the deprecated code for `setAuthor()` and `setFooter()`.
11
12
@@ -314,8 +315,18 @@ class MessageEmbed {
314
315
* @param {string } value The value of this field
315
316
* @param {boolean } [inline=false] If this field will be displayed inline
316
317
* @returns {MessageEmbed }
318
+ * @deprecated This method is a wrapper for {@link MessageEmbed#addFields}. Use that instead.
317
319
*/
318
320
addField ( name , value , inline ) {
321
+ if ( ! deprecationEmittedForAddField ) {
322
+ process . emitWarning (
323
+ // eslint-disable-next-line max-len
324
+ 'MessageEmbed#addField is deprecated and will be removed in the next major update. Use MessageEmbed#addFields instead.' ,
325
+ 'DeprecationWarning' ,
326
+ ) ;
327
+
328
+ deprecationEmittedForAddField = true ;
329
+ }
319
330
return this . addFields ( { name, value, inline } ) ;
320
331
}
321
332
Original file line number Diff line number Diff line change @@ -1765,6 +1765,7 @@ export class MessageEmbed {
1765
1765
public type : string ;
1766
1766
public url : string | null ;
1767
1767
public readonly video : MessageEmbedVideo | null ;
1768
+ /** @deprecated This method is a wrapper for {@link MessageEmbed#addFields}. Use that instead. */
1768
1769
public addField ( name : string , value : string , inline ?: boolean ) : this;
1769
1770
public addFields ( ...fields : EmbedFieldData [ ] | EmbedFieldData [ ] [ ] ) : this;
1770
1771
public setFields ( ...fields : EmbedFieldData [ ] | EmbedFieldData [ ] [ ] ) : this;
You can’t perform that action at this time.
0 commit comments