Skip to content

Commit

Permalink
feat: deprecate ActionRow.from() (#8504)
Browse files Browse the repository at this point in the history
* feat: deprecate `ActionRow.from()`

* feat: deprecate `ActionRow.from()`

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
Syjalo and kodiakhq[bot] committed Aug 18, 2022
1 parent 7474026 commit f9c25dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions 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');
Expand All @@ -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)) {
Expand All @@ -41,4 +43,6 @@ class ActionRow extends Component {
}
}

ActionRow.from = deprecate(ActionRow.from, 'ActionRow.from() is deprecated. Use ActionRowBuilder.from() instead.');

module.exports = ActionRow;

0 comments on commit f9c25dd

Please sign in to comment.