mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
refactor: deprecate v13 properties and methods (#7782)
* refactor: deprecate splitting * refactor: deprecate `IntegrationApplication#summary` https://github.com/discordjs/discord.js/pull/7729 * docs: amend store channel wording * refactor: deprecate fetching of application assets * docs: deprecate vip field in voice regions
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
const process = require('node:process');
|
||||
const { ClientApplicationAssetTypes, Endpoints } = require('../../util/Constants');
|
||||
const SnowflakeUtil = require('../../util/SnowflakeUtil');
|
||||
const Base = require('../Base');
|
||||
|
||||
const AssetTypes = Object.keys(ClientApplicationAssetTypes);
|
||||
|
||||
let deprecationEmittedForFetchAssets = false;
|
||||
|
||||
/**
|
||||
* Represents an OAuth2 Application.
|
||||
* @abstract
|
||||
@@ -103,8 +106,18 @@ class Application extends Base {
|
||||
/**
|
||||
* Gets the application's rich presence assets.
|
||||
* @returns {Promise<Array<ApplicationAsset>>}
|
||||
* @deprecated This will be removed in the next major as it is unsupported functionality.
|
||||
*/
|
||||
async fetchAssets() {
|
||||
if (!deprecationEmittedForFetchAssets) {
|
||||
process.emitWarning(
|
||||
'Application#fetchAssets is deprecated as it is unsupported and will be removed in the next major version.',
|
||||
'DeprecationWarning',
|
||||
);
|
||||
|
||||
deprecationEmittedForFetchAssets = true;
|
||||
}
|
||||
|
||||
const assets = await this.client.api.oauth2.applications(this.id).assets.get();
|
||||
return assets.map(a => ({
|
||||
id: a.id,
|
||||
|
||||
Reference in New Issue
Block a user