mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat: deprecate ActionRow.from() (#8504)
* feat: deprecate `ActionRow.from()` * feat: deprecate `ActionRow.from()` Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const { deprecate } = require('node:util');
|
||||
const { isJSONEncodable } = require('@discordjs/builders');
|
||||
const Component = require('./Component');
|
||||
const { createComponent } = require('../util/Components');
|
||||
@@ -24,6 +25,7 @@ class ActionRow extends Component {
|
||||
* Creates a new action row builder from JSON data
|
||||
* @param {JSONEncodable<APIActionRowComponent>|APIActionRowComponent} other The other data
|
||||
* @returns {ActionRowBuilder}
|
||||
* @deprecated Use {@link ActionRowBuilder.from()} instead.
|
||||
*/
|
||||
static from(other) {
|
||||
if (isJSONEncodable(other)) {
|
||||
@@ -41,4 +43,6 @@ class ActionRow extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
ActionRow.from = deprecate(ActionRow.from, 'ActionRow.from() is deprecated. Use ActionRowBuilder.from() instead.');
|
||||
|
||||
module.exports = ActionRow;
|
||||
|
||||
Reference in New Issue
Block a user