From f9c25ddcfe68f089e13f1090c3df4bd7cd74d2b7 Mon Sep 17 00:00:00 2001 From: Synbulat Biishev Date: Thu, 18 Aug 2022 12:06:01 +0500 Subject: [PATCH] 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> --- packages/discord.js/src/structures/ActionRow.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/discord.js/src/structures/ActionRow.js b/packages/discord.js/src/structures/ActionRow.js index d5fb48561..67aeebbaa 100644 --- a/packages/discord.js/src/structures/ActionRow.js +++ b/packages/discord.js/src/structures/ActionRow.js @@ -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} 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;